[Zope3-checkins] CVS: Zope3/src/zope/app/services - service.py:1.33
Philipp von Weitershausen
cvs-admin at zope.org
Fri Dec 5 09:42:02 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv23148/services
Modified Files:
service.py
Log Message:
Changed Jim's fix. We now remove the proxies in the view. The SiteManager
really shouldn't bother about unproxying objects.
Also, whitespace and style updates.
=== Zope3/src/zope/app/services/service.py 1.32 => 1.33 ===
--- Zope3/src/zope/app/services/service.py:1.32 Fri Dec 5 09:15:27 2003
+++ Zope3/src/zope/app/services/service.py Fri Dec 5 09:42:01 2003
@@ -36,8 +36,6 @@
from zope.component import getServiceManager
from zope.component.exceptions import ComponentLookupError
-from zope.proxy import removeAllProxies
-
from zope.app.component.nextservice import getNextService
from zope.app.component.nextservice import getNextServiceManager
@@ -60,9 +58,8 @@
from zope.app.location import inside
class SiteManager(BTreeContainer,
- PersistentModuleRegistry,
- NameComponentRegistry,
- ):
+ PersistentModuleRegistry,
+ NameComponentRegistry):
implements(IServiceManager)
@@ -79,8 +76,7 @@
def _setNext(self, site):
"""Find set the next service manager
"""
-
- while 1:
+ while True:
if IContainmentRoot.isImplementedBy(site):
# we're the root site, use the global sm
self.next = zapi.getServiceManager(None)
@@ -89,12 +85,13 @@
if site is None:
raise TypeError("Not enough context information")
if ISite.isImplementedBy(site):
- self.next = removeAllProxies(site.getSiteManager())
+ self.next = site.getSiteManager()
self.next.addSubsite(self)
return
def addSubsite(self, sub):
-
+ """See IServiceManager interface
+ """
subsite = sub.__parent__
# Update any sites that are now in the subsite:
@@ -110,8 +107,8 @@
self.subSites = tuple(subsites)
def getServiceDefinitions(wrapped_self):
- "See IServiceService"
-
+ """See IServiceService
+ """
# Get the services defined here and above us, if any (as held
# in a ServiceInterfaceService, presumably)
sm = getNextServiceManager(wrapped_self)
@@ -122,14 +119,16 @@
return serviceDefs
def queryService(wrapped_self, name, default=None):
- "See IServiceService"
+ """See IServiceService
+ """
try:
return wrapped_self.getService(name)
except ComponentLookupError:
return default
def getService(wrapped_self, name):
- "See IServiceService"
+ """See IServiceService
+ """
# This is rather tricky. Normally, getting a service requires
# the use of other services, like the adapter service. We
@@ -155,7 +154,8 @@
def queryLocalService(wrapped_self, name, default=None):
- "See IServiceManager"
+ """See IServiceManager
+ """
# This is rather tricky. Normally, getting a service requires
# the use of other services, like the adapter service. We
@@ -180,10 +180,9 @@
return default
-
-
def getInterfaceFor(wrapped_self, service_type):
- "See IServiceService"
+ """See IServiceService
+ """
for type, interface in wrapped_self.getServiceDefinitions():
if type == service_type:
return interface
More information about the Zope3-Checkins
mailing list