[Zope-Checkins] CVS: Zope3/lib/python/Zope/ComponentArchitecture - IServiceManagerContainer.py:1.3 ServiceManagerContainer.py:1.4

Jim Fulton jim@zope.com
Mon, 15 Jul 2002 18:01:42 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/ComponentArchitecture
In directory cvs.zope.org:/tmp/cvs-serv3603/lib/python/Zope/ComponentArchitecture

Modified Files:
	IServiceManagerContainer.py ServiceManagerContainer.py 
Log Message:
Added logic to the ZopePublication object to handle placeful
authentication services.

Fixed some bugs in the service manager and made the mapping
implementation there handle only local services.

Refactored the tests in ZopePublication to push some of the
browser-specific tests down to the Browser package.



=== Zope3/lib/python/Zope/ComponentArchitecture/IServiceManagerContainer.py 1.2 => 1.3 ===
 
 class IReadServiceManagerContainer(Interface):
 
-    def getServiceManager(default=None):
+    def getServiceManager():
         """Returns the service manager contained in this object.
 
-        If there isn't a service manager, we return the default or
-        raise a component lookup error if no default was provided.
+        If there isn't a service manager, raise a component lookup.
+        """
+
+    def queryServiceManager(default=None):
+        """Returns the service manager contained in this object.
+
+        If there isn't a service manager, return the default.
         """
 
     def hasServiceManager():


=== Zope3/lib/python/Zope/ComponentArchitecture/ServiceManagerContainer.py 1.3 => 1.4 ===
         '''See interface IReadServiceManagerContainer'''
         return hasattr(self, '_ServiceManagerContainer__sm')
 
-    def getServiceManager(self, default=_marker):
+    def getServiceManager(self):
         '''See interface IReadServiceManagerContainer'''
 
         try:
-            return self.__sm # no name
+            return self.__sm
         except AttributeError:
-            if default is _marker:
-                raise ComponentLookupError
-            else:
-                return default
+            raise ComponentLookupError('no service manager defined')
+
+    def queryServiceManager(self, default=None):
+        '''See interface IReadServiceManagerContainer'''
+
+        return getattr(self, '_ServiceManagerContainer__sm', default)
 
     def setServiceManager(self, sm):
         '''See interface IWriteServiceManagerContainer'''