[Zope3-checkins] CVS: Zope3/src/zope/app/component - directiveswithperms.py:1.1.2.3 meta.zcml:1.3.2.2

Steve Alexander steve@cat-box.net
Sun, 18 May 2003 17:01:32 -0400


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

Modified Files:
      Tag: stevea-decorators-branch
	directiveswithperms.py meta.zcml 
Log Message:
Added usedfor attribute to decorator directive.
Updated docs.


=== Zope3/src/zope/app/component/directiveswithperms.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/app/component/directiveswithperms.py:1.1.2.2	Thu May 15 10:49:26 2003
+++ Zope3/src/zope/app/component/directiveswithperms.py	Sun May 18 17:01:01 2003
@@ -258,7 +258,8 @@
     classProvides(INonEmptyDirective)
     implements(ISubdirectiveHandler)
 
-    def __init__(self, _context, id, class_, names=None, trusted='untrusted'):
+    def __init__(self, _context, id, class_, names=None, usedfor=None,
+                 trusted='untrusted'):
         self._id = id
         self._class = _context.resolve(class_)
         if not names:
@@ -278,6 +279,11 @@
         else:
             raise ConfigurationError('Value of "trusted" must be "trusted" or'
                                      ' "untrusted".')
+        # usedfor is ignored. It appears in zcml for documentation only.
+        # If it is given, it should be an interface, so we do actually
+        # resolve it even though we don't need it.
+        if usedfor is not None:
+            _context.resolve(usedfor)
 
     def __call__(self):
         class_ = self._class


=== Zope3/src/zope/app/component/meta.zcml 1.3.2.1 => 1.3.2.2 ===
--- Zope3/src/zope/app/component/meta.zcml:1.3.2.1	Wed May 14 13:44:09 2003
+++ Zope3/src/zope/app/component/meta.zcml	Sun May 18 17:01:01 2003
@@ -71,6 +71,13 @@
             are defined.
         </description>
       </attribute>
+      <attribute name="usedfor" required="no">
+        <description>
+            Dotted module name of the interface that the mixin class
+            expects its 'inner' object to provide.
+            This attribute is used only for documentation.
+        </description>
+      </attribute>
       <attribute name="trusted" required="no">
         <description>
             Takes either the value 'trusted' or the value 'untrusted'.