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

Gary Poster gary@modernsongs.com
Thu, 10 Apr 2003 09:47:08 -0400


My memory is that the HubIds service used to pass IObjectAdded events 
unmodified and unfiltered to its subscribers.  It no longer does this.

Would this be a preferred behavior?

Gary


Ulrich Eck wrote:
> 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)
> 
> 
> _______________________________________________
> Zope3-Checkins mailing list
> Zope3-Checkins@zope.org
> http://mail.zope.org/mailman/listinfo/zope3-checkins
> 
>