[pypy-svn] r44303 - in pypy/dist/pypy/translator/js: examples examples/bnb examples/test lib modules test

fijal at codespeak.net fijal at codespeak.net
Sat Jun 16 14:27:28 CEST 2007


Author: fijal
Date: Sat Jun 16 14:27:27 2007
New Revision: 44303

Modified:
   pypy/dist/pypy/translator/js/examples/bnb/bnb.py
   pypy/dist/pypy/translator/js/examples/overmind.py
   pypy/dist/pypy/translator/js/examples/pythonconsole.py
   pypy/dist/pypy/translator/js/examples/test/test_examples.py
   pypy/dist/pypy/translator/js/lib/support.py
   pypy/dist/pypy/translator/js/modules/dom.py
   pypy/dist/pypy/translator/js/modules/mochikit.py
   pypy/dist/pypy/translator/js/test/test_bltn.py
   pypy/dist/pypy/translator/js/test/test_extfunc.py
   pypy/dist/pypy/translator/js/test/test_str.py
Log:
Rename extfunc._callable to extfunc.genericcallable to avoid confusion


Modified: pypy/dist/pypy/translator/js/examples/bnb/bnb.py
==============================================================================
--- pypy/dist/pypy/translator/js/examples/bnb/bnb.py	(original)
+++ pypy/dist/pypy/translator/js/examples/bnb/bnb.py	Sat Jun 16 14:27:27 2007
@@ -8,7 +8,6 @@
 from pypy.translator.js.examples.bnb.servermessage import log, ServerMessage,\
     PMSG_INLINE_FRAME, PMSG_DEF_ICON
 from pypy.translator.js.examples.bnb.msgstruct import *
-from pypy.rpython.extfunc import _callable
 from pypy.translator.js.lib.support import callback
 from pypy.translator.js.lib import server
 

Modified: pypy/dist/pypy/translator/js/examples/overmind.py
==============================================================================
--- pypy/dist/pypy/translator/js/examples/overmind.py	(original)
+++ pypy/dist/pypy/translator/js/examples/overmind.py	Sat Jun 16 14:27:27 2007
@@ -7,7 +7,6 @@
 
 from pypy.translator.js.lib import server
 from pypy.translator.js.lib.support import callback
-from pypy.rpython.extfunc import _callable
 from pypy.rpython.ootypesystem.bltregistry import described
 from pypy.translator.js.main import rpython2javascript
 from pypy.translator.js.examples.console import console

Modified: pypy/dist/pypy/translator/js/examples/pythonconsole.py
==============================================================================
--- pypy/dist/pypy/translator/js/examples/pythonconsole.py	(original)
+++ pypy/dist/pypy/translator/js/examples/pythonconsole.py	Sat Jun 16 14:27:27 2007
@@ -16,7 +16,7 @@
 from pypy.translator.js.modules.mochikit import connect, disconnect
 from pypy.rpython.ootypesystem.bltregistry import MethodDesc, BasicExternal
 from pypy.translator.js import commproxy
-from pypy.rpython.extfunc import _callable
+from pypy.rpython.extfunc import genericcallable
 
 from pypy.translator.js.lib import support
 from pypy.translator.js.lib import server
@@ -102,8 +102,8 @@
     # Methods and signatures how they are rendered for JS
     _methods = {
         'some_callback' : MethodDesc([('cmd', str),
-                                      ('callback', _callable([{str:str}]))],
-                                     {str:str})
+                          ('callback', genericcallable([{str:str}]))],
+                           {str:str})
     }
     
     _render_xmlhttp = True

Modified: pypy/dist/pypy/translator/js/examples/test/test_examples.py
==============================================================================
--- pypy/dist/pypy/translator/js/examples/test/test_examples.py	(original)
+++ pypy/dist/pypy/translator/js/examples/test/test_examples.py	Sat Jun 16 14:27:27 2007
@@ -29,7 +29,7 @@
 def test_console_2_build():
     from pypy.translator.js.examples.console import console, client
     assert rpython2javascript(client, console.FUNCTION_LIST,
-                              use_pdb=False)
+                              use_pdb=True)
 
 def test_ping_play1():
     from urllib import URLopener

Modified: pypy/dist/pypy/translator/js/lib/support.py
==============================================================================
--- pypy/dist/pypy/translator/js/lib/support.py	(original)
+++ pypy/dist/pypy/translator/js/lib/support.py	Sat Jun 16 14:27:27 2007
@@ -5,7 +5,7 @@
 from pypy.rpython.ootypesystem.bltregistry import described, load_dict_args,\
      MethodDesc
 
-from pypy.rpython.extfunc import _callable
+from pypy.rpython.extfunc import genericcallable
 
 def callback(retval=None, args={}):
     """ Variant of described decorator, which flows
@@ -21,7 +21,7 @@
             arg_list = load_dict_args(vars, defs, args)
         else:
             arg_list = args
-        arg_list.append(("callback", _callable(args=[retval])))
+        arg_list.append(("callback", genericcallable(args=[retval])))
         func._method = (func.__name__, MethodDesc(arg_list, retval))
         return func
 

Modified: pypy/dist/pypy/translator/js/modules/dom.py
==============================================================================
--- pypy/dist/pypy/translator/js/modules/dom.py	(original)
+++ pypy/dist/pypy/translator/js/modules/dom.py	Sat Jun 16 14:27:27 2007
@@ -21,12 +21,11 @@
 from pypy.rpython.ootypesystem.bltregistry import BasicExternal, MethodDesc
 from pypy.rlib.nonconst import NonConstant
 
-from pypy.rpython.extfunc import _callable, register_external
+from pypy.rpython.extfunc import genericcallable, register_external
 from xml.dom import minidom
 
 from pypy.annotation.signature import annotation
 from pypy.annotation import model as annmodel
-from pypy.rpython.extfunc import _callable
 
 # EventTarget is the base class for Nodes and Window
 class EventTarget(BasicExternal):
@@ -333,7 +332,7 @@
 
 def setTimeout(func, delay):
     pass
-register_external(setTimeout, args=[_callable([]), int], result=None)
+register_external(setTimeout, args=[genericcallable([]), int], result=None)
 
 window = Window()
 document = window.document
@@ -343,31 +342,31 @@
 # rtyper stuff
 
 EventTarget._fields = {
-    'onabort' : _callable([Event]),
-    'onblur' : _callable([Event]),
-    'onchange' : _callable([Event]),
-    'onclick' : _callable([MouseEvent]),
-    'onclose' : _callable([MouseEvent]),
-    'ondblclick' : _callable([MouseEvent]),
-    'ondragdrop' : _callable([MouseEvent]),
-    'onerror' : _callable([MouseEvent]),
-    'onfocus' : _callable([Event]),
-    'onkeydown' : _callable([KeyEvent]),
-    'onkeypress' : _callable([KeyEvent]),
-    'onkeyup' : _callable([KeyEvent]),
-    'onload' : _callable([KeyEvent]),
-    'onmousedown' : _callable([MouseEvent]),
-    'onmousemove' : _callable([MouseEvent]),
-    'onmouseup' : _callable([MouseEvent]),
-    'onmouseover' : _callable([MouseEvent]),
-    'onresize' : _callable([Event]),
-    'onscroll' : _callable([MouseEvent]),
-    'onselect' : _callable([MouseEvent]),
-    'onsubmit' : _callable([MouseEvent]),
-    'onunload' : _callable([Event]),
+    'onabort' : genericcallable([Event]),
+    'onblur' : genericcallable([Event]),
+    'onchange' : genericcallable([Event]),
+    'onclick' : genericcallable([MouseEvent]),
+    'onclose' : genericcallable([MouseEvent]),
+    'ondblclick' : genericcallable([MouseEvent]),
+    'ondragdrop' : genericcallable([MouseEvent]),
+    'onerror' : genericcallable([MouseEvent]),
+    'onfocus' : genericcallable([Event]),
+    'onkeydown' : genericcallable([KeyEvent]),
+    'onkeypress' : genericcallable([KeyEvent]),
+    'onkeyup' : genericcallable([KeyEvent]),
+    'onload' : genericcallable([KeyEvent]),
+    'onmousedown' : genericcallable([MouseEvent]),
+    'onmousemove' : genericcallable([MouseEvent]),
+    'onmouseup' : genericcallable([MouseEvent]),
+    'onmouseover' : genericcallable([MouseEvent]),
+    'onresize' : genericcallable([Event]),
+    'onscroll' : genericcallable([MouseEvent]),
+    'onselect' : genericcallable([MouseEvent]),
+    'onsubmit' : genericcallable([MouseEvent]),
+    'onunload' : genericcallable([Event]),
 }
 
-lambda_returning_true = _callable([Event])
+lambda_returning_true = genericcallable([Event])
 
 EventTarget._methods = {
     'addEventListener' : MethodDesc([str, lambda_returning_true, bool]),

Modified: pypy/dist/pypy/translator/js/modules/mochikit.py
==============================================================================
--- pypy/dist/pypy/translator/js/modules/mochikit.py	(original)
+++ pypy/dist/pypy/translator/js/modules/mochikit.py	Sat Jun 16 14:27:27 2007
@@ -2,7 +2,7 @@
 """ mochikit wrappers
 """
 
-from pypy.rpython.extfunc import _callable, register_external
+from pypy.rpython.extfunc import genericcallable, register_external
 from pypy.rpython.ootypesystem.bltregistry import BasicExternal, MethodDesc
 from pypy.translator.js.modules import dom
 
@@ -62,7 +62,7 @@
 
 def connect(src, signal, dest):
     print 'connecting signal %s' % (signal,)
-register_external(connect, args=[dom.EventTarget, str, _callable([Event])],
+register_external(connect, args=[dom.EventTarget, str, genericcallable([Event])],
                   result=int)
 
 def disconnect(id):

Modified: pypy/dist/pypy/translator/js/test/test_bltn.py
==============================================================================
--- pypy/dist/pypy/translator/js/test/test_bltn.py	(original)
+++ pypy/dist/pypy/translator/js/test/test_bltn.py	Sat Jun 16 14:27:27 2007
@@ -5,7 +5,7 @@
 
 from pypy.rpython.ootypesystem.bltregistry import BasicExternal, MethodDesc
 from pypy.translator.js.test.runtest import compile_function, check_source_contains
-from pypy.rpython.extfunc import _callable
+from pypy.rpython.extfunc import genericcallable
 from pypy.translator.js import commproxy
 
 # check rendering dom.document
@@ -28,7 +28,7 @@
     
 class SomeNode(BasicExternal):
     _fields = {
-        'some_callback' : _callable([int], int),
+        'some_callback' : genericcallable([int], int),
     }
 
 SomeProxyInstance = SomeProxy()

Modified: pypy/dist/pypy/translator/js/test/test_extfunc.py
==============================================================================
--- pypy/dist/pypy/translator/js/test/test_extfunc.py	(original)
+++ pypy/dist/pypy/translator/js/test/test_extfunc.py	Sat Jun 16 14:27:27 2007
@@ -3,7 +3,6 @@
 """
 
 from pypy.translator.js.test.runtest import compile_function, check_source_contains
-from pypy.rpython.extfunc import _callable
 
 def test_set_timeout():
     from pypy.translator.js.modules.dom import setTimeout

Modified: pypy/dist/pypy/translator/js/test/test_str.py
==============================================================================
--- pypy/dist/pypy/translator/js/test/test_str.py	(original)
+++ pypy/dist/pypy/translator/js/test/test_str.py	Sat Jun 16 14:27:27 2007
@@ -4,7 +4,7 @@
 import pypy.translator.oosupport.test_template.string as oostring
 
 
-# ====> ../../../rpython/test/test_str.py
+# ====> ../../../rpython/test/test_rstr.py
 
 class TestJsString(JsTest, oostring.BaseTestString):
     def test_char_unichar_eq(self):



More information about the Pypy-commit mailing list