[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ComponentArchitecture - component-meta.zcml:1.1.2.3 component.zcml:1.1.2.4 metaConfigure.py:1.1.2.4

Jim Fulton jim@zope.com
Mon, 3 Jun 2002 14:25:29 -0400


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

Modified Files:
      Tag: Zope3InWonderland-branch
	component-meta.zcml component.zcml metaConfigure.py 
Log Message:
Changed list attribute syntax to be more XML standard.
In particular, list attributes now expect items to be separated by
whitespace, rather than commas.


=== Zope3/lib/python/Zope/App/ComponentArchitecture/component-meta.zcml 1.1.2.2 => 1.1.2.3 ===
   <directives namespace="http://namespaces.zope.org/zope">
 
-    <directive name="adapter" attributes="factory, provides, for"
+    <directive name="adapter" attributes="factory provides for"
        handler="Zope.App.ComponentArchitecture.metaConfigure.adapter" />
 
-    <directive name="utility" attributes="component, provides"
+    <directive name="utility" attributes="component provides"
        handler="Zope.App.ComponentArchitecture.metaConfigure.utility" />
 
-    <directive name="factory" attributes="component, id"
+    <directive name="factory" attributes="component id"
        handler="Zope.App.ComponentArchitecture.metaConfigure.factory" />
 
     <directive 
        name="view" 
-       attributes="component, type, name, for, layer,
-                   permission, allowed_interface, allowed_attributes"
+       attributes="component type name for layer
+                   permission allowed_interface allowed_attributes"
        handler="Zope.App.ComponentArchitecture.metaConfigure.view" />
 
     <directive name="defaultView" 
-               attributes="component, type, name, for, layer"
+               attributes="component type name for layer"
        handler="Zope.App.ComponentArchitecture.metaConfigure.defaultView" />
 
     <directive 
        name="resource" 
-       attributes="component, type, name, layer,
-                   permission, allowed_interface, allowed_attributes"
+       attributes="component type name layer
+                   permission allowed_interface allowed_attributes"
        handler="Zope.App.ComponentArchitecture.metaConfigure.resource" />
 
-    <directive name="skin" attributes="name, type, layers" 
+    <directive name="skin" attributes="name type layers" 
         handler="Zope.App.ComponentArchitecture.metaConfigure.skin" />
     
-    <directive name="serviceType" attributes="name, interface"
+    <directive name="serviceType" attributes="name interface"
        handler="Zope.App.ComponentArchitecture.metaConfigure.serviceType" />
 
-    <directive name="service" attributes="name, component"
+    <directive name="service" attributes="name component"
        handler="Zope.App.ComponentArchitecture.metaConfigure.service" />
 
   </directives>


=== Zope3/lib/python/Zope/App/ComponentArchitecture/component.zcml 1.1.2.3 => 1.1.2.4 ===
     <security:protect interface=".IViewService+"
              permission="Zope.Public" />
-    <security:protect names="provideView, setDefaultViewName"
+    <security:protect names="provideView setDefaultViewName"
              permission="Zope.ManageServices" />
 </security:protectClass>
 


=== Zope3/lib/python/Zope/App/ComponentArchitecture/metaConfigure.py 1.1.2.3 => 1.1.2.4 ===
     return checker
 
-def resource(_context, factory, type, name, layer='',
+def resource(_context, factory, type, name, layer='default',
              permission=None,
              allowed_interface=None, allowed_attributes=None):
 
@@ -141,7 +141,7 @@
             )
         ]
 
-def view(_context, factory, type, name, for_=None, layer='',
+def view(_context, factory, type, name, for_=None, layer='default',
          permission=None, allowed_interface=None, allowed_attributes=None):
 
 
@@ -218,7 +218,10 @@
 
 def skin(_context, name, layers, type):
     type = _context.resolve(type)
-    layers = [layer.strip() for layer in layers.split(',')]
+    if ',' in layers:
+        raise TypeError("Commas are not allowed in layer names.")
+
+    layers = layers.strip().split()
     return [
         Action(
             discriminator = ('skin', name, type),