[Zope3-checkins] CVS: Zope3/src/zope/app/event - objectevent.py:1.12

Jim Fulton jim at zope.com
Mon Mar 15 15:42:13 EST 2004


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

Modified Files:
	objectevent.py 
Log Message:
Changed to reflect changes in subscription api


=== Zope3/src/zope/app/event/objectevent.py 1.11 => 1.12 ===
--- Zope3/src/zope/app/event/objectevent.py:1.11	Fri Mar  5 17:09:02 2004
+++ Zope3/src/zope/app/event/objectevent.py	Mon Mar 15 15:41:42 2004
@@ -26,8 +26,7 @@
 from zope.app.event.interfaces import ISubscriber
 from zope.interface import implements
 from zope.app.event import publish
-from zope.component import querySubscriptionMultiAdapter
-from zope.component import getService
+from zope.app import zapi
 
 _marker = object()
 
@@ -80,8 +79,7 @@
 
     def notify(self, event):
         assert IObjectEvent.providedBy(event)
-        adapters = querySubscriptionMultiAdapter((event.object, event),
-                                                 ISubscriber, context=None)
+        adapters = zapi.subscribers((event.object, event), ISubscriber)
         for adapter in adapters:
             adapter.notify(event)
 
@@ -94,8 +92,8 @@
     callback will be called with an ObjectEvent instance. Example usage:
 
     factory = objectEventCallbackHelper(events.append)
-    getService(None, Adapters).provideSubscriptionAdapter(
-        MyObjectType, ISubscriber, [factory], with=[IObjectRemovedEvent]
+    getService(None, Adapters).subscribe(
+        [MyObjectType, IObjectRemovedEvent], ISubscriber, factory
     )
     """
     class _CallbackHelper:




More information about the Zope3-Checkins mailing list