[Zope3-checkins] CVS: Zope3/lib/python/Zope/Event - ISubscribable.py:1.4 Subscribable.py:1.5

Gary Poster gary@modernsongs.com
Mon, 21 Oct 2002 02:15:18 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/Event
In directory cvs.zope.org:/tmp/cvs-serv13005/Zope/Event

Modified Files:
	ISubscribable.py Subscribable.py 
Log Message:
sorry for the huge honking checkin.

Adds a simple local objecthub implementation and made ObjectHub a service

Modifies the main objecthub as we have been discussing:
 * objecthub attribute is hubid, not hid (sorry Jim, I'll change it back if you want but there were a lot of "yay"s and no "nay"s :-)
 * no more IObjectAddedHubEvent
 * IObjectRemovedEvent now (hopefully) actually has the effect on the ObjectHub that is described in the interface, and that we agreed upon, namely (assuming removed object was cataloged in objecthub) removing catalog of object in objecthub and sending out an IObjectRemovedHubEvent, subclass of IObjectUnregisteredHubEvent, to the ObjectHub subscribers

I tried to spruce up the LocalEventService a bit but the code still looks as opaque as ever, I'm afraid.  Among other small improvements, though, at least you actually can see the silly "user interface" now without a traceback.  Now for a *real* user interface sometime. :-)

Fixed a few typos while I was at it as well...and I'm sure made my share of new ones :-)




=== Zope3/lib/python/Zope/Event/ISubscribable.py 1.3 => 1.4 ===
--- Zope3/lib/python/Zope/Event/ISubscribable.py:1.3	Tue Sep  3 16:13:38 2002
+++ Zope3/lib/python/Zope/Event/ISubscribable.py	Mon Oct 21 02:14:47 2002
@@ -82,8 +82,9 @@
         If event_type is None, the default value, the subscriber is
         unsubscribed completely for all event types from this
         subscribable (and its parents, if the subscribable is a placeful
-        service).  If no subscriptions for this subscriber are
-        present, no error is raised.
+        service).  The filter argument is ignored in this case.  If no
+        subscriptions for this subscriber are present, no error is
+        raised.
         
         if event_type is supplied, this method will unsubscribe the
         subscriber from one subscription exactly matching the


=== Zope3/lib/python/Zope/Event/Subscribable.py 1.4 => 1.5 ===
--- Zope3/lib/python/Zope/Event/Subscribable.py:1.4	Thu Sep  5 17:30:09 2002
+++ Zope3/lib/python/Zope/Event/Subscribable.py	Mon Oct 21 02:14:47 2002
@@ -28,6 +28,7 @@
     """a global mix-in"""
     
     __implements__ = ISubscribable
+        # plus has subscriptionsForEvent
 
     def __init__(self):
         self._registry = TypeRegistry()
@@ -113,6 +114,10 @@
         self._registry=self._registry #trigger persistence, if pertinent
 
     def subscriptionsForEvent(self, event):
+        # XXX currently a non-interface method:
+        # just a more readable prettification
+        # used only for notify methods now.  Could this be replaced
+        # with an explanatory comment in the code that uses it?
         return self._registry.getAllForObject(event)
     
     def listSubscriptions(self, subscriber, event_type=None):