Log message for revision 69446: Merge from 1.2 branch: Log message for revision 69443: Fix: Allow multiple uses of the <class>/<content> directive. Also, reduce the code duplication in the directive handler tremendously by using the zope 3 implementation as a base class.
Changed: U Products.Five/branches/1.3/CHANGES.txt U Products.Five/branches/1.3/metaconfigure.py A Products.Five/branches/1.3/tests/classes.py U Products.Five/branches/1.3/tests/directives.zcml U Products.Five/branches/1.3/tests/test_directives.py U Products.Five/branches/1.3/tests/test_security.py U Products.Five/branches/1.3/version.txt -=- Modified: Products.Five/branches/1.3/CHANGES.txt =================================================================== --- Products.Five/branches/1.3/CHANGES.txt 2006-08-13 18:57:44 UTC (rev 69445) +++ Products.Five/branches/1.3/CHANGES.txt 2006-08-13 19:01:27 UTC (rev 69446) @@ -2,12 +2,14 @@ Five Changes ============ -Five 1.3.7 (unreleased) +Five 1.3.7 (2006-08-13) ======================= Bugfixes -------- +* Allow multiple uses of the <class>/<content> directive. + * Fix problem with WebDAV/HEAD requests due to new traversal order. * Backported the new traversal lookup order from Zope 2.10 (attribute, adapter, @@ -174,6 +176,16 @@ components has been removed as that functionality is now in the Zope 2 core as of Zope 2.9. +Five 1.2.6 (2006-08-13) +======================= + +* Allow multiple uses of the <class>/<content> directive. + +* Fix problem with WebDAV/HEAD requests due to new traversal order. + +* Backported the new traversal lookup order from Zope 2.10 (attribute, + adapter, acquired attribute). + Five 1.2.5 (2006-05-29) ======================= Modified: Products.Five/branches/1.3/metaconfigure.py =================================================================== --- Products.Five/branches/1.3/metaconfigure.py 2006-08-13 18:57:44 UTC (rev 69445) +++ Products.Five/branches/1.3/metaconfigure.py 2006-08-13 19:01:27 UTC (rev 69446) @@ -15,14 +15,12 @@ $Id$ """ -from Products.Five.security import CheckerPublic, protectName -from Globals import InitializeClass as initializeClass +from zope.configuration.exceptions import ConfigurationError +from zope.app.component import contentdirective +from Products.Five.security import protectName, initializeClass -from zope.app.component.contentdirective import ContentDirective as \ - zope_app_ContentDirective +class ContentDirective(contentdirective.ContentDirective): -class ContentDirective(zope_app_ContentDirective): - def __protectName(self, name, permission_id): self.__context.action( discriminator = ('five:protectName', self.__class, name), @@ -30,10 +28,18 @@ args = (self.__class, name, permission_id) ) + def __protectSetAttributes(self, attributes, permissions): + raise ConfigurationError('set_attributes parameter not supported.') + + def __proctectSetSchema(self, schema, permission): + raise ConfigurationError('set_schema parameter not supported.') + + def __mimic(self, _context, class_): + raise ConfigurationError('like_class parameter not supported.') + def __call__(self): - """Handle empty/simple declaration.""" return self.__context.action( - discriminator = ('five:initialize:class', self.__class), + discriminator = None, callable = initializeClass, args = (self.__class,) ) Copied: Products.Five/branches/1.3/tests/classes.py (from rev 69443, Products.Five/branches/1.2/tests/classes.py) Modified: Products.Five/branches/1.3/tests/directives.zcml =================================================================== --- Products.Five/branches/1.3/tests/directives.zcml 2006-08-13 18:57:44 UTC (rev 69445) +++ Products.Five/branches/1.3/tests/directives.zcml 2006-08-13 19:01:27 UTC (rev 69446) @@ -47,4 +47,15 @@ factory=".adapters.OriginalAdapter" /> + <!-- this tests whether content / class can be declared on the same class + with two different interfaces. --> + + <class class=".classes.One" > + <implements interface=".classes.IOne" /> + </class> + + <class class=".classes.One" > + <implements interface=".classes.ITwo" /> + </class> + </configure> Modified: Products.Five/branches/1.3/tests/test_directives.py =================================================================== --- Products.Five/branches/1.3/tests/test_directives.py 2006-08-13 18:57:44 UTC (rev 69445) +++ Products.Five/branches/1.3/tests/test_directives.py 2006-08-13 19:01:27 UTC (rev 69446) @@ -59,6 +59,14 @@ >>> dest.method() 'Overridden' + Check the result of the <class> directives + + >>> from Products.Five.tests.classes import One, Two, IOne, ITwo + >>> IOne.implementedBy(One) + True + >>> ITwo.implementedBy(One) + True + Clean up adapter registry and others: >>> from zope.testing.cleanup import cleanUp Modified: Products.Five/branches/1.3/tests/test_security.py =================================================================== --- Products.Five/branches/1.3/tests/test_security.py 2006-08-13 18:57:44 UTC (rev 69445) +++ Products.Five/branches/1.3/tests/test_security.py 2006-08-13 19:01:27 UTC (rev 69446) @@ -72,13 +72,15 @@ >>> configure_zcml = ''' ... <configure xmlns="http://namespaces.zope.org/zope"> - ... <content class="Products.Five.tests.test_security.Dummy1"> + ... <class class="Products.Five.tests.test_security.Dummy1"> ... <allow attributes="foo" /> ... <!--deny attributes="baz" /--> <!-- XXX not yet supported --> + ... </class> + ... <class class="Products.Five.tests.test_security.Dummy1"> ... <require attributes="bar keg" ... permission="zope2.ViewManagementScreens" ... /> - ... </content> + ... </class> ... </configure> ... ''' >>> zcml.load_string(configure_zcml) Modified: Products.Five/branches/1.3/version.txt =================================================================== --- Products.Five/branches/1.3/version.txt 2006-08-13 18:57:44 UTC (rev 69445) +++ Products.Five/branches/1.3/version.txt 2006-08-13 19:01:27 UTC (rev 69446) @@ -1 +1 @@ -Five 1.3.6+ +Five 1.3.7 _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins