[pypy-svn] r38880 - pypy/dist/pypy/doc/js
fijal at codespeak.net
fijal at codespeak.net
Thu Feb 15 14:27:10 CET 2007
Author: fijal
Date: Thu Feb 15 14:27:09 2007
New Revision: 38880
Modified:
pypy/dist/pypy/doc/js/using.txt
Log:
Minor API changes
Modified: pypy/dist/pypy/doc/js/using.txt
==============================================================================
--- pypy/dist/pypy/doc/js/using.txt (original)
+++ pypy/dist/pypy/doc/js/using.txt Thu Feb 15 14:27:09 2007
@@ -94,10 +94,12 @@
tell the JS backend to render it using xmlhttp communication. Because
the web server code does not need to be rpython, you have to supply some
way of telling PyPy what types can be returned out of it. This is done
-using the decorator `@described(retval = <used type>)` from
+using the decorator `@callback(retval = <used type>)` from
`bltregistry`_. For example you may provide::
- @described(retval = {str:str})
+ from pypy.translator.js.lib.support import callback
+
+ @callback(retval = {str:str})
def some_fun(self, some_arg = 3):
....
@@ -121,12 +123,13 @@
On the server side::
- from pypy.rpython.ootypesystem.bltregistry import BasicExternal, described
+ from pypy.rpython.ootypesystem.bltregistry import BasicExternal
+ from pypy.translator.js.lib.support import callback
class PingHandler(BasicExternal):
_render_xmlhttp = True
- @described(retval={str:str})
+ @callback(retval={str:str})
def ping(self, ping_str="aa"):
return dict(response="PONG: %s" % ping_str)
More information about the Pypy-commit
mailing list