[Zope3-checkins] CVS: Zope3/src/zope/app/contentdirective - contentdirective.py:1.9

Jim Fulton jim@zope.com
Tue, 18 Mar 2003 16:02:52 -0500


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

Modified Files:
	contentdirective.py 
Log Message:
Removed "Packages" from the object hierarchy in site managers (service
managers).  We now traverse directly from site managers to individual
site-management folders.

This change is backward compatible because the underlying data
structures haven't changed.


=== Zope3/src/zope/app/contentdirective/contentdirective.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/contentdirective/contentdirective.py:1.8	Tue Feb 11 21:17:18 2003
+++ Zope3/src/zope/app/contentdirective/contentdirective.py	Tue Mar 18 16:02:21 2003
@@ -62,25 +62,29 @@
         self.__context = _context
 
     def implements(self, _context, interface):
-        resolved_interface = _context.resolve(interface)
-        return [
-            Action(
-                discriminator = ('ContentDirective', self.__class, object()),
-                callable = implements,
-                # the last argument is check=1, which causes implements
-                # to verify that the class does implement the interface
-                args = (self.__class, resolved_interface, 1),
-                ),
-            Action(
-               discriminator = None,
-               callable = handler,
-               args = (Interfaces, 'provideInterface',
-                       resolved_interface.__module__+
-                       '.'+
-                       resolved_interface.__name__,
-                       resolved_interface)
-               )
-            ]
+        r = []
+        for interface in interface.strip().split():
+
+            resolved_interface = _context.resolve(interface)
+            r += [
+                Action(
+                    discriminator = ('ContentDirective', self.__class, object()),
+                    callable = implements,
+                    # the last argument is check=1, which causes implements
+                    # to verify that the class does implement the interface
+                    args = (self.__class, resolved_interface, 1),
+                    ),
+                Action(
+                   discriminator = None,
+                   callable = handler,
+                   args = (Interfaces, 'provideInterface',
+                           resolved_interface.__module__+
+                           '.'+
+                           resolved_interface.__name__,
+                           resolved_interface)
+                   )
+                ]
+        return r
 
     def require(self, _context,
                 permission=None, attributes=None, interface=None,
@@ -102,13 +106,15 @@
 
 
         if interface:
-            self.__protectByInterface(interface, permission, r)
+            for i in interface.strip().split():
+                self.__protectByInterface(i, permission, r)
         if attributes:
             self.__protectNames(attributes, permission, r)
         if set_attributes:
             self.__protectSetAttributes(set_attributes, permission, r)
         if set_schema:
-            self.__protectSetSchema(set_schema, permission, r)
+            for s in set_schema.strip().split():
+                self.__protectSetSchema(s, permission, r)
 
 
         return r