[Checkins] SVN: zc.async/trunk/s zc.async events inherit from 'zc.component.interfaces.IObjectEvent' instead of a zc.async specific IObjectEvent.

Satchidanand Haridas satchit at zope.com
Thu Sep 4 18:35:56 EDT 2008


Log message for revision 90850:
  zc.async events inherit from 'zc.component.interfaces.IObjectEvent' instead of a zc.async specific IObjectEvent.
  
  

Changed:
  U   zc.async/trunk/setup.py
  U   zc.async/trunk/src/zc/async/interfaces.py
  U   zc.async/trunk/src/zc/async/subscribers.txt

-=-
Modified: zc.async/trunk/setup.py
===================================================================
--- zc.async/trunk/setup.py	2008-09-04 22:17:21 UTC (rev 90849)
+++ zc.async/trunk/setup.py	2008-09-04 22:35:56 UTC (rev 90850)
@@ -72,7 +72,7 @@
 
 setup(
     name='zc.async',
-    version='1.4.2a5',
+    version='1.4.2a6',
     namespace_packages=['zc'],
     packages=find_packages('src'),
     package_dir={'':'src'},

Modified: zc.async/trunk/src/zc/async/interfaces.py
===================================================================
--- zc.async/trunk/src/zc/async/interfaces.py	2008-09-04 22:17:21 UTC (rev 90849)
+++ zc.async/trunk/src/zc/async/interfaces.py	2008-09-04 22:35:56 UTC (rev 90850)
@@ -109,46 +109,41 @@
         """right before committing a job, retry is given a chance to stash
         information it has saved in the data_cache."""
 
-class IObjectEvent(zope.interface.Interface):
-    """Event happened to object"""
-
-    object = zope.interface.Attribute('the object')
-
 class AbstractObjectEvent(object):
     def __init__(self, object):
         self.object = object
 
-class IDispatcherRegistered(IObjectEvent):
+class IDispatcherRegistered(zope.component.interfaces.IObjectEvent):
     """Dispatcher was registered"""
 
 class DispatcherRegistered(AbstractObjectEvent):
     zope.interface.implements(IDispatcherRegistered)
 
-class IDispatcherUnregistered(IObjectEvent):
+class IDispatcherUnregistered(zope.component.interfaces.IObjectEvent):
     """Dispatcher was unregistered"""
 
 class DispatcherUnregistered(AbstractObjectEvent):
     zope.interface.implements(IDispatcherUnregistered)
 
-class IDispatcherActivated(IObjectEvent):
+class IDispatcherActivated(zope.component.interfaces.IObjectEvent):
     """Dispatcher was activated"""
 
 class DispatcherActivated(AbstractObjectEvent):
     zope.interface.implements(IDispatcherActivated)
 
-class IDispatcherDeactivated(IObjectEvent):
+class IDispatcherDeactivated(zope.component.interfaces.IObjectEvent):
     """Dispatcher was deactivated"""
 
 class DispatcherDeactivated(AbstractObjectEvent):
     zope.interface.implements(IDispatcherDeactivated)
 
-class IDispatcherReactivated(IObjectEvent):
+class IDispatcherReactivated(zope.component.interfaces.IObjectEvent):
     """Dispatcher was reactivated after mistaken deactivation"""
 
 class DispatcherReactivated(AbstractObjectEvent):
     zope.interface.implements(IDispatcherReactivated)
 
-class IObjectAdded(IObjectEvent):
+class IObjectAdded(zope.component.interfaces.IObjectEvent):
     """Object was added to the database"""
 
     parent = zope.interface.Attribute(

Modified: zc.async/trunk/src/zc/async/subscribers.txt
===================================================================
--- zc.async/trunk/src/zc/async/subscribers.txt	2008-09-04 22:17:21 UTC (rev 90849)
+++ zc.async/trunk/src/zc/async/subscribers.txt	2008-09-04 22:35:56 UTC (rev 90850)
@@ -167,6 +167,20 @@
     added to <class 'zc.async.queue.Queues'>
     with name ''
 
+
+Note that all the events inherit from IObjectEvent.
+
+    >>> import zope.component.interfaces
+    >>> for event in eventtesting.getEvents(
+    ...         zope.component.interfaces.IObjectEvent):
+    ...     print event.__class__
+    <class 'zope.component.interfaces.Unregistered'>
+    <class 'zc.async.interfaces.ObjectAdded'>
+    <class 'zc.async.interfaces.ObjectAdded'>
+    <class 'zc.async.interfaces.DispatcherRegistered'>
+    <class 'zc.async.interfaces.DispatcherActivated'>
+
+
 Finally, we mentioned at the start that the threaded dispatcher installer also
 installed some signal handlers.  Let's show a SIGINT (CTRL-C, usually), and
 how it deactivates the dispatcher's agents collection in the ZODB.



More information about the Checkins mailing list