[Zope3-checkins] CVS: Zope3/src/zope/app/event - globalservice.py:1.15 subs.py:1.26

Jim Fulton jim at zope.com
Sat Mar 6 12:49:20 EST 2004


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

Modified Files:
	globalservice.py subs.py 
Log Message:
Changed most calls to queryAdapter to use interface calls instead.


=== Zope3/src/zope/app/event/globalservice.py 1.14 => 1.15 ===
--- Zope3/src/zope/app/event/globalservice.py:1.14	Fri Mar  5 17:09:02 2004
+++ Zope3/src/zope/app/event/globalservice.py	Sat Mar  6 12:48:49 2004
@@ -19,7 +19,6 @@
 
 from zope.interface.type import TypeRegistry
 from zope.interface import implements
-from zope.component import queryAdapter
 from zope.exceptions import NotFoundError
 from zope.proxy import removeAllProxies
 
@@ -76,7 +75,7 @@
         checkEventType(event_type)
         clean_subscriber = removeAllProxies(subscriber)
 
-        subscribingaware = queryAdapter(subscriber, ISubscribingAware)
+        subscribingaware = ISubscribingAware(subscriber, None)
         if subscribingaware is not None:
             subscribingaware.subscribedTo(self, event_type, filter)
 
@@ -117,7 +116,7 @@
                 # been done by a local service
                 return
 
-        subscribingaware = queryAdapter(subscriber, ISubscribingAware)
+        subscribingaware = ISubscribingAware(subscriber, None)
 
         if event_type:
             ev_type = event_type
@@ -204,7 +203,7 @@
         for subscriber, filter in subscriptions:
             if filter is not None and not filter(event):
                 continue
-            queryAdapter(subscriber, ISubscriber).notify(event)
+            ISubscriber(subscriber).notify(event)
 
 class GlobalEventChannel(GlobalSubscribable):
 


=== Zope3/src/zope/app/event/subs.py 1.25 => 1.26 ===
--- Zope3/src/zope/app/event/subs.py:1.25	Sat Mar  6 11:50:22 2004
+++ Zope3/src/zope/app/event/subs.py	Sat Mar  6 12:48:49 2004
@@ -28,7 +28,7 @@
 from zope.app.event.interfaces import IEvent, ISubscriber, ISubscribable
 from zope.app.event.interfaces import ISubscribingAware
 
-from zope.component import getService, queryService, queryAdapter
+from zope.component import getService, queryService
 from zope.app.services.servicenames import HubIds
 from zope.app.services.type import PersistentTypeRegistry
 from cPickle import dumps, PicklingError
@@ -111,7 +111,7 @@
         evtype_numsubs[ev_type] += 1
         tokens[token] = evtype_numsubs
 
-        subscribingaware = queryAdapter(wrapped_object, ISubscribingAware)
+        subscribingaware = ISubscribingAware(wrapped_object, None)
         if subscribingaware is not None:
             subscribingaware.subscribedTo(wrapped_self, event_type, filter)
 
@@ -202,7 +202,7 @@
             # No subscription was removed.
             raise NotFoundError(reference)
 
-        subscribingaware = queryAdapter(wrappedobj, ISubscribingAware)
+        subscribingaware = ISubscribingAware(wrappedobj, None)
         if subscribingaware is not None:
             subscribingaware.unsubscribedFrom(wrapped_self, event_type, filter)
 
@@ -225,7 +225,7 @@
                 "Unsubscribing all for an object that doesn't exist: %s" %
                 reference)
 
-        subscribingaware = queryAdapter(wrappedobj, ISubscribingAware)
+        subscribingaware = ISubscribingAware(wrappedobj, None)
 
         registry = clean_self._registry
         if event_type is IEvent:




More information about the Zope3-Checkins mailing list