[py-svn] r51124 - in py/branch/event/py: . event event/testing

hpk at codespeak.net hpk at codespeak.net
Wed Jan 30 13:05:55 CET 2008


Author: hpk
Date: Wed Jan 30 13:05:54 2008
New Revision: 51124

Modified:
   py/branch/event/py/__init__.py
   py/branch/event/py/event/hub.py
   py/branch/event/py/event/testing/test_hub.py
Log:
adding a commented out global hub (not sure we need it) 
and enabling py.event namespace in py/__init__.py 


Modified: py/branch/event/py/__init__.py
==============================================================================
--- py/branch/event/py/__init__.py	(original)
+++ py/branch/event/py/__init__.py	Wed Jan 30 13:05:54 2008
@@ -51,6 +51,11 @@
     'test.collect.Item'      : ('./test/item.py', 'Item'),
     'test.collect.Function'  : ('./test/item.py', 'Function'),
 
+    # Event related APIs
+    'event.Hub'              : ('./event/hub.py', 'Hub'), 
+    #'event.hub'              : ('./event/hub.py', 'hub'), 
+    #'event.notify'           : ('./event/hub.py', 'notify'), 
+
     # thread related API (still in early design phase)
     '_thread.WorkerPool'      : ('./thread/pool.py', 'WorkerPool'),
     '_thread.NamedThreadPool' : ('./thread/pool.py', 'NamedThreadPool'),

Modified: py/branch/event/py/event/hub.py
==============================================================================
--- py/branch/event/py/event/hub.py	(original)
+++ py/branch/event/py/event/hub.py	Wed Jan 30 13:05:54 2008
@@ -4,3 +4,8 @@
     def notify(self, event):
         for subscriber in self:
             subscriber(event) 
+
+
+# XXX do we want a global hub? 
+#hub = Hub()
+#notify = hub.notify 

Modified: py/branch/event/py/event/testing/test_hub.py
==============================================================================
--- py/branch/event/py/event/testing/test_hub.py	(original)
+++ py/branch/event/py/event/testing/test_hub.py	Wed Jan 30 13:05:54 2008
@@ -31,3 +31,4 @@
         hub.remove(l.append) 
         hub.notify(2)
         assert l == [1]
+



More information about the pytest-commit mailing list