[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/ServiceManager - ServiceManager.py:1.6

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


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/ServiceManager
In directory cvs.zope.org:/tmp/cvs-serv3603/lib/python/Zope/App/OFS/Services/ServiceManager

Modified Files:
	ServiceManager.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/App/OFS/Services/ServiceManager/ServiceManager.py 1.5 => 1.6 ===
     ############################################################
 
 
+    # We provide a mapping interface for traversal, but we only expose
+    # local services through the mapping interface.
+
     def __getitem__(self, key):
         "See Interface.Common.Mapping.IReadMapping"
 
@@ -281,7 +284,13 @@
         if key == 'Packages':
             return self.Packages
 
-        return self.queryService(key, default)
+        directives = self.__bindings.get(key)
+        if directives and directives[0] is not None:
+            return self.queryService(key, default)
+
+        return default
+
+    get = ContextMethod(get)
 
     def __contains__(self, key):
         "See Interface.Common.Mapping.IReadMapping"