[Zope3-checkins] CVS: Zope3/src/zope/app/services - auth.py:1.26 event.py:1.39 hub.py:1.33 presentation.py:1.6 registration.py:1.24

Jim Fulton jim at zope.com
Sat Mar 6 11:51:01 EST 2004


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

Modified Files:
	auth.py event.py hub.py presentation.py registration.py 
Log Message:
Converted most getAdapter calls to use interface calls instead.


=== Zope3/src/zope/app/services/auth.py 1.25 => 1.26 ===
--- Zope3/src/zope/app/services/auth.py:1.25	Wed Mar  3 05:38:51 2004
+++ Zope3/src/zope/app/services/auth.py	Sat Mar  6 11:50:30 2004
@@ -20,7 +20,7 @@
 from BTrees.OOBTree import OOBTree
 
 from zope.exceptions import NotFoundError
-from zope.component import getAdapter, queryAdapter
+from zope.component import queryAdapter
 from zope.app.services.servicenames import Authentication
 
 from zope.app.container.interfaces import IContainer
@@ -90,7 +90,7 @@
         'See IAuthenticationService'
         # XXX This is a mess. request has no place here!
         if id is None:
-            a = getAdapter(request, ILoginPassword)
+            a = ILoginPassword(request)
             a.needLogin(realm="zope")
 
     def getPrincipal(self, id):


=== Zope3/src/zope/app/services/event.py 1.38 => 1.39 ===
--- Zope3/src/zope/app/services/event.py:1.38	Fri Mar  5 17:09:16 2004
+++ Zope3/src/zope/app/services/event.py	Sat Mar  6 11:50:30 2004
@@ -126,7 +126,7 @@
                 # is no ISubscriber adapter available, that is an application
                 # error that should be fixed. So, failing is appropriate, and
                 # adding this subscriber to badSubscribers is inappropriate.
-                zapi.getAdapter(obj, ISubscriber).notify(event)
+                ISubscriber(obj).notify(event)
 
         for subscriber in badSubscribers:
             logging.getLogger('SiteError').warn(


=== Zope3/src/zope/app/services/hub.py 1.32 => 1.33 ===
--- Zope3/src/zope/app/services/hub.py:1.32	Fri Mar  5 17:09:16 2004
+++ Zope3/src/zope/app/services/hub.py	Sat Mar  6 11:50:30 2004
@@ -23,7 +23,7 @@
 from BTrees.IOBTree import IOBTree
 from BTrees.OIBTree import OIBTree
 
-from zope.component import getAdapter, getService
+from zope.component import getService
 from zope.exceptions import NotFoundError
 from zope.proxy import removeAllProxies
 from zope.app.services.servicenames import EventSubscription
@@ -117,7 +117,7 @@
     def __getObject(self):
         obj = self.__object
         if obj is None:
-            adapter = getAdapter(self.hub, ITraverser)
+            adapter = ITraverser(self.hub)
             try:
                 obj = self.__object = adapter.traverse(self.location)
             except NotFoundError:
@@ -333,7 +333,7 @@
     def getObject(self, hubid):
         '''See interface IObjectHub'''
         path = self.getPath(hubid)
-        adapter = getAdapter(self, ITraverser)
+        adapter = ITraverser(self)
         return adapter.traverse(path)
 
     def register(self, path_or_object):
@@ -418,7 +418,7 @@
 
     def iterObjectRegistrations(self, path=u'/'):
         """See interface IHubEventChannel"""
-        traverser = getAdapter(self, ITraverser)
+        traverser = ITraverser(self)
         for path, hubId in self.iterRegistrations(path):
             yield (path, hubId, self._safeTraverse(path, traverser))
 
@@ -528,7 +528,7 @@
             return
         # Register subobjects
         names = object.keys()
-        traversable = getAdapter(object, ITraversable)
+        traversable = ITraversable(object)
         for name in names:
             sub_object = traverseName(object, name, traversable=traversable)
             self._registerTree(sub_object, hub)


=== Zope3/src/zope/app/services/presentation.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/services/presentation.py:1.5	Wed Mar  3 05:38:51 2004
+++ Zope3/src/zope/app/services/presentation.py	Sat Mar  6 11:50:30 2004
@@ -489,7 +489,7 @@
     def addNotify(self, event):
         "See IAddNotifiable"
         template = zapi.traverse(self.__parent__.__parent__,self.template)
-        dependents = zapi.getAdapter(template, IDependable)
+        dependents = IDependable(template)
         objectpath = zapi.getPath(self)
         dependents.addDependent(objectpath)
         # Also update usage, if supported
@@ -502,7 +502,7 @@
         "See IRemoveNotifiable"
         super(PageRegistration, self).removeNotify(event)
         template = zapi.traverse(self.__parent__.__parent__,self.template)
-        dependents = zapi.getAdapter(template, IDependable)
+        dependents = IDependable(template)
         objectpath = zapi.getPath(self)
         dependents.addDependent(objectpath)
         # Also update usage, if supported


=== Zope3/src/zope/app/services/registration.py 1.23 => 1.24 ===
--- Zope3/src/zope/app/services/registration.py:1.23	Fri Mar  5 17:09:16 2004
+++ Zope3/src/zope/app/services/registration.py	Sat Mar  6 11:50:30 2004
@@ -430,7 +430,7 @@
     def addNotify(self, event):
         "See IAddNotifiable"
         component = self.getComponent()
-        dependents = zapi.getAdapter(component, IDependable)
+        dependents = IDependable(component)
         objectpath = zapi.getPath(self)
         dependents.addDependent(objectpath)
         # Also update usage, if supported
@@ -442,7 +442,7 @@
         "See IRemoveNotifiable"
         super(ComponentRegistration, self).removeNotify(event)
         component = self.getComponent()
-        dependents = zapi.getAdapter(component, IDependable)
+        dependents = IDependable(component)
         objectpath = zapi.getPath(self)
         dependents.removeDependent(objectpath)
         # Also update usage, if supported




More information about the Zope3-Checkins mailing list