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

Gary Poster garyposter@earthlink.net
Thu, 2 May 2002 13:17:52 -0400


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

Modified Files:
      Tag: Zope-3x-branch
	IServiceManagerContainer.py ServiceManagerContainer.py 
Log Message:
Several interfaces divided up into readers (getters) and writers (setters), then used in the zcml for permissions.  Some small changes in the local ServiceManager to deal with the new security a bit better, hopefully.  Fixed Image enough so that you can upload one, but I'm getting a server buffer error when I try to view it.  The change to ZMIViewUtility I'm not sure of, but it made sense to me.

You can now add, edit, and view significantly more of the content since the security changes.



=== Zope3/lib/python/Zope/ComponentArchitecture/IServiceManagerContainer.py 1.1.2.4 => 1.1.2.5 ===
 from Interface import Interface
 
-class IServiceManagerContainer(Interface):
+class IReadServiceManagerContainer(Interface):
 
     def getServiceManager(default=None):
         """Returns the service manager contained in this object.
@@ -27,9 +27,15 @@
         raise a component lookup error if no default was provided.
         """
 
+    def hasServiceManager():
+        """Query to find out if the component defines a service manager."""
+
+class IWriteServiceManagerContainer(Interface):
+
     def setServiceManager(sm):
         """Sets the service manager for this object."""
 
-    def hasServiceManager():
-        """Query to find out if the component defines a service manager."""
+class IServiceManagerContainer(IReadServiceManagerContainer,
+                               IWriteServiceManagerContainer):
+    pass
 


=== Zope3/lib/python/Zope/ComponentArchitecture/ServiceManagerContainer.py 1.1.2.5 => 1.1.2.6 ===
 
     def hasServiceManager(self):
-        '''See interface IServiceManagerContainer'''
+        '''See interface IReadServiceManagerContainer'''
 
         return hasattr(self, '_ServiceManagerContainer__sm')
 
     def getServiceManager(wrapped_self, default=_marker):
-        '''See interface IServiceManagerContainer'''
+        '''See interface IReadServiceManagerContainer'''
 
         try:
             return ContextWrapper(wrapped_self.__sm, wrapped_self) # no name
@@ -52,7 +52,7 @@
     getServiceManager=ContextMethod(getServiceManager)
 
     def setServiceManager(self, sm):
-        '''See interface IServiceManagerContainer'''
+        '''See interface IWriteServiceManagerContainer'''
 
         if IServiceManager.isImplementedBy(sm):
             self.__sm = sm