[Zope-Checkins]
SVN: Products.Five/branches/philikon-local-components/meta
Add missing <class /> directive and deprecate <content />
Philipp von Weitershausen
philikon at philikon.de
Wed Apr 19 13:13:07 EDT 2006
Log message for revision 67149:
Add missing <class /> directive and deprecate <content />
Changed:
U Products.Five/branches/philikon-local-components/meta.zcml
U Products.Five/branches/philikon-local-components/metaconfigure.py
-=-
Modified: Products.Five/branches/philikon-local-components/meta.zcml
===================================================================
--- Products.Five/branches/philikon-local-components/meta.zcml 2006-04-19 16:55:18 UTC (rev 67148)
+++ Products.Five/branches/philikon-local-components/meta.zcml 2006-04-19 17:13:06 UTC (rev 67149)
@@ -51,6 +51,30 @@
/>
<meta:complexDirective
+ name="class"
+ schema="zope.app.component.metadirectives.IClassDirective"
+ handler=".metaconfigure.ClassDirective"
+ >
+
+ <meta:subdirective
+ name="implements"
+ schema="zope.app.component.metadirectives.IImplementsSubdirective"
+ />
+
+ <meta:subdirective
+ name="require"
+ schema="zope.app.component.metadirectives.IRequireSubdirective"
+ />
+
+ <meta:subdirective
+ name="allow"
+ schema="zope.app.component.metadirectives.IAllowSubdirective"
+ />
+
+ </meta:complexDirective>
+
+ <!-- BBB 2006/02/24, to be removed after 12 months -->
+ <meta:complexDirective
name="content"
schema="zope.app.component.metadirectives.IClassDirective"
handler=".metaconfigure.ContentDirective"
Modified: Products.Five/branches/philikon-local-components/metaconfigure.py
===================================================================
--- Products.Five/branches/philikon-local-components/metaconfigure.py 2006-04-19 16:55:18 UTC (rev 67148)
+++ Products.Five/branches/philikon-local-components/metaconfigure.py 2006-04-19 17:13:06 UTC (rev 67149)
@@ -17,11 +17,9 @@
"""
from Products.Five.security import CheckerPublic, protectName
from Globals import InitializeClass as initializeClass
+import zope.app.component.contentdirective
-from zope.app.component.contentdirective import ContentDirective as \
- zope_app_ContentDirective
-
-class ContentDirective(zope_app_ContentDirective):
+class ClassDirective(zope.app.component.contentdirective.ClassDirective):
def __protectName(self, name, permission_id):
self.__context.action(
@@ -37,3 +35,13 @@
callable = initializeClass,
args = (self.__class,)
)
+
+# BBB 2006/02/24, to be removed after 12 months
+class ContentDirective(ClassDirective):
+
+ def __init__(self, _context, class_):
+ warnings.warn_explicit(
+ "The 'content' alias for the 'class' directive has been "
+ "deprecated and will be removed in Zope 2.12.\n",
+ DeprecationWarning, _context.info.file, _context.info.line)
+ super(ContentDirective, self).__init__(_context, class_)
More information about the Zope-Checkins
mailing list