[Zope3-checkins] CVS: Zope3/src/zope/app/services - event.py:1.32

Steve Alexander steve@cat-box.net
Tue, 17 Jun 2003 15:54:49 -0400


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

Modified Files:
	event.py 
Log Message:
Fix to collector issue 168.

This fix is a sticking-plaster. The dependencies and uses of the
mixins provided as part of the event service need documenting and
re-evaluating. I don't have time to do that just now.


=== Zope3/src/zope/app/services/event.py 1.31 => 1.32 ===
--- Zope3/src/zope/app/services/event.py:1.31	Tue Jun 17 03:44:35 2003
+++ Zope3/src/zope/app/services/event.py	Tue Jun 17 15:54:48 2003
@@ -208,6 +208,15 @@
         # unsubscribe all subscriptions
         hubIds = clean_self._hubIds
         unsubscribeAll = wrapped_self.unsubscribeAll
+
+        # XXX Temporary hack to make unsubscriptions local in scope when
+        #     this mix-in is used as part of a subscriptions service.
+        #     The dependences of these mixins need to be documented and
+        #     reevaluated.
+        if ISubscriptionService.isImplementedBy(wrapped_self):
+            real_unsubscribeAll = unsubscribeAll
+            unsubscribeAll = lambda x: real_unsubscribeAll(x, local_only=True)
+
         try:
             clean_self._v_ssecunbinding = True
             while hubIds:
@@ -220,14 +229,14 @@
                 #     to decide what it should be unsubscribing from.
                 #     This could be any service that implements
                 #     ISubscriptionService
-                unsubscribeAll(hubId, local_only=True)
+                unsubscribeAll(hubId)
 
             paths = clean_self._paths
             while paths:
                 path = iter(paths).next()
                 # XXX This code path needs a unit test!
                 #     Also, see comment above.
-                unsubscribeAll(path, local_only=True)
+                unsubscribeAll(path)
         finally:
             del clean_self._v_ssecunbinding