[Zope3-checkins] CVS: Zope3/src/zope/app/index - subscribers.py:1.13

Ulrich Eck ueck@net-labs.de
Thu, 10 Apr 2003 08:53:52 -0400


Update of /cvs-repository/Zope3/src/zope/app/index
In directory cvs.zope.org:/tmp/cvs-serv23009

Modified Files:
	subscribers.py 
Log Message:
fixed a bug: the registration-subscriber component subscribed for
ObjectAddedEvents at the HubIds Service .. so it never got notified.


=== Zope3/src/zope/app/index/subscribers.py 1.12 => 1.13 ===
--- Zope3/src/zope/app/index/subscribers.py:1.12	Sun Mar 23 17:35:39 2003
+++ Zope3/src/zope/app/index/subscribers.py	Thu Apr 10 08:53:52 2003
@@ -38,6 +38,7 @@
 from zope.proxy.context import ContextMethod
 from zope.component import getService, queryAdapter
 from zope.app.services.servicenames import HubIds
+from zope.app.services.servicenames import EventSubscription
 
 from zope.app.traversing import traverse, traverseName, getPath, getRoot
 from zope.app.interfaces.services.hub import ObjectHubError
@@ -72,7 +73,7 @@
             raise RuntimeError, "already subscribed; please unsubscribe first"
         # we subscribe to the HubIds service so that we're
         # guaranteed to get exactly the events *that* service receives.
-        events = getService(wrapped_self, HubIds)
+        events = getService(wrapped_self, EventSubscription)
         events.subscribe(wrapped_self, IObjectAddedEvent)
         wrapped_self.currentlySubscribed = True
     subscribe = ContextMethod(subscribe)
@@ -80,7 +81,7 @@
     def unsubscribe(wrapped_self):
         if not wrapped_self.currentlySubscribed:
             raise RuntimeError, "not subscribed; please subscribe first"
-        events = getService(wrapped_self, HubIds)
+        events = getService(wrapped_self, EventSubscription)
         events.unsubscribe(wrapped_self, IObjectAddedEvent)
         wrapped_self.currentlySubscribed = False
     unsubscribe = ContextMethod(unsubscribe)