[Zope3-checkins] CVS: Zope3/src/zope/app/component - metaconfigure.py:1.6

Jim Fulton jim@zope.com
Mon, 3 Feb 2003 13:22:10 -0500


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

Modified Files:
	metaconfigure.py 
Log Message:
Changed zope:view and zope:defaultView to require a for attr, but
allow *.


=== Zope3/src/zope/app/component/metaconfigure.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/component/metaconfigure.py:1.5	Mon Feb  3 13:08:48 2003
+++ Zope3/src/zope/app/component/metaconfigure.py	Mon Feb  3 13:22:08 2003
@@ -215,9 +215,12 @@
               )
         ]
 
-def view(_context, factory, type, name, for_=None, layer='default',
+def view(_context, factory, type, name, for_, layer='default',
          permission=None, allowed_interface=None, allowed_attributes=None):
 
+    if for_ == '*':
+        for_ = None
+
     if ((allowed_attributes or allowed_interface)
         and (not permission)):
         raise ConfigurationError(
@@ -270,7 +273,10 @@
 
     return actions
 
-def defaultView(_context, type, name, for_=None, **__kw):
+def defaultView(_context, type, name, for_, **__kw):
+
+    if for_ == '*':
+        for_ = None
 
     if __kw:
         actions = view(_context, type=type, name=name, for_=for_, **__kw)