Log message for revision 69450: 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/trunk/CHANGES.txt U Products.Five/trunk/metaconfigure.py A Products.Five/trunk/tests/classes.py U Products.Five/trunk/tests/directives.zcml U Products.Five/trunk/tests/test_directives.py U Products.Five/trunk/tests/test_security.py -=- Modified: Products.Five/trunk/CHANGES.txt =================================================================== --- Products.Five/trunk/CHANGES.txt 2006-08-13 19:08:16 UTC (rev 69449) +++ Products.Five/trunk/CHANGES.txt 2006-08-13 19:16:44 UTC (rev 69450) @@ -2,13 +2,15 @@ Five Changes ============ -Five 1.5 (unreleased) +Five 1.5 (2006-08-13) ===================== * Enabled the viewlet related directives by default. * Added acquisition wrappers to viewlets before updating or rendering. +* Allow multiple uses of the <class>/<content> directive. + * Moved the custom 'provider:' tales expression back into Five. Made the provider directive acquisition wrap the resultant content provider so that simple providers that need security declarations (e.g. those that render @@ -79,6 +81,28 @@ deprecated, as the functionality exists in the Zope core publisher from Zope 2.10 and up. +Five 1.4.1 (2006-08-13) +======================= + +Bugfixes +-------- + +* Allow multiple uses of the <class>/<content> directive. + +* Fix problem with WebDAV/HEAD requests due to new traversal order. + +* Made the pythonproducts monkey patching more robust by checking to + ensure patches aren't reapplied and cleaning up after itself. + +* Backported the new traversal lookup order from Zope 2.10 (attribute, adapter, + acquired attribute). + +* Made the provider directive acquisition wrap the resultant content provider + so that simple providers that need security declarations (e.g. those that + render pagetemplates) can work with the Zope 2 security machinery. + +* Added acquisition wrappers to viewlets before updating or rendering. + Five 1.4 (2006-05-29) ===================== @@ -141,6 +165,22 @@ NOTE: Anyone who copied the Five site.zcml to their $INSTANCE_HOME/etc/ directory is going to need to update it. +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, + acquired attribute). + +* fiveconfigure.py: Removed import of deprecated 'LOG' object from 'zLOG' + in favor of the facilities provided by Python's 'logging' module. + Five 1.3.6 (2006-05-29) ======================= @@ -299,6 +339,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/trunk/metaconfigure.py =================================================================== --- Products.Five/trunk/metaconfigure.py 2006-08-13 19:08:16 UTC (rev 69449) +++ Products.Five/trunk/metaconfigure.py 2006-08-13 19:16:44 UTC (rev 69450) @@ -15,13 +15,12 @@ $Id$ """ -import warnings -from Products.Five.security import CheckerPublic, protectName -from Globals import InitializeClass as initializeClass -import zope.app.component.contentdirective +from zope.configuration.exceptions import ConfigurationError +from zope.app.component import contentdirective +from Products.Five.security import protectName, initializeClass -class ClassDirective(zope.app.component.contentdirective.ClassDirective): - +class ClassDirective(contentdirective.ClassDirective): + def __protectName(self, name, permission_id): self.__context.action( discriminator = ('five:protectName', self.__class, name), @@ -29,16 +28,24 @@ 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,) ) # BBB 2006/02/24, to be removed after 12 months -class ContentDirective(ClassDirective): +class ContentDirective(contentdirective.ClassDirective): def __init__(self, _context, class_): warnings.warn_explicit( Copied: Products.Five/trunk/tests/classes.py (from rev 69449, Products.Five/branches/1.4/tests/classes.py) Modified: Products.Five/trunk/tests/directives.zcml =================================================================== --- Products.Five/trunk/tests/directives.zcml 2006-08-13 19:08:16 UTC (rev 69449) +++ Products.Five/trunk/tests/directives.zcml 2006-08-13 19:16:44 UTC (rev 69450) @@ -24,4 +24,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/trunk/tests/test_directives.py =================================================================== --- Products.Five/trunk/tests/test_directives.py 2006-08-13 19:08:16 UTC (rev 69449) +++ Products.Five/trunk/tests/test_directives.py 2006-08-13 19:16:44 UTC (rev 69450) @@ -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/trunk/tests/test_security.py =================================================================== --- Products.Five/trunk/tests/test_security.py 2006-08-13 19:08:16 UTC (rev 69449) +++ Products.Five/trunk/tests/test_security.py 2006-08-13 19:16:44 UTC (rev 69450) @@ -75,6 +75,8 @@ ... <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" ... /> _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins