[Zope3-checkins] CVS: Zope3/src/zope/app/component - hooks.py:1.11 nextservice.py:1.7

Jim Fulton jim at zope.com
Tue Sep 2 17:47:16 EDT 2003


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

Modified Files:
	hooks.py nextservice.py 
Log Message:
Added ISite, which is a marker interface indicating that an object is
a site.

When an object is made into a site, ISite is declared for it.

Change to test whether something is a site by testing whether 
it (declares it) implements ISite.


=== Zope3/src/zope/app/component/hooks.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/component/hooks.py:1.10	Fri Aug 15 20:43:18 2003
+++ Zope3/src/zope/app/component/hooks.py	Tue Sep  2 16:46:45 2003
@@ -20,7 +20,7 @@
 from zope.component.interfaces import IServiceService
 from zope.component.exceptions import ComponentLookupError
 from zope.component.servicenames import Adapters
-from zope.app.interfaces.services.service import IServiceManagerContainer
+from zope.app.interfaces.services.service import ISite
 from zope.app.context import ContextWrapper
 from zope.context import getWrapperContainer, isWrapper, getWrapperData
 from zope.component.service import serviceManager
@@ -97,11 +97,9 @@
     if IServiceService.isImplementedBy(clean_context):
         sm = trustedRemoveSecurityProxy(context)
 
-    elif (IServiceManagerContainer.isImplementedBy(clean_context) and
-        clean_context.hasServiceManager()
-        ):
+    elif (ISite.isImplementedBy(clean_context)):
         sm = ContextWrapper(
-            trustedRemoveSecurityProxy(context.getServiceManager()),
+            trustedRemoveSecurityProxy(context.getSiteManager()),
             context,
             name="++etc++site",
             )


=== Zope3/src/zope/app/component/nextservice.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/component/nextservice.py:1.6	Wed May 28 11:46:04 2003
+++ Zope3/src/zope/app/component/nextservice.py	Tue Sep  2 16:46:45 2003
@@ -20,7 +20,7 @@
 from zope.component.service import serviceManager
 from zope.context import getWrapperContainer
 from zope.proxy import removeAllProxies
-from zope.app.interfaces.services.service import IServiceManagerContainer
+from zope.app.interfaces.services.service import ISite
 from zope.app.component.hooks import getServiceManager_hook
 
 # placeful service manager convenience tools
@@ -63,8 +63,7 @@
 
     # But we're *really* paranoid, so we'll double check.
     while ((container is not None) and not
-           IServiceManagerContainer.isImplementedBy(
-                      removeAllProxies(container))
+           ISite.isImplementedBy(removeAllProxies(container))
            ):
         container = getWrapperContainer(container) # we should be
 




More information about the Zope3-Checkins mailing list