[Zope-Checkins] SVN: Products.Five/branches/1.4/ Merge from 1.2
branch:
Philipp von Weitershausen
philikon at philikon.de
Sun Aug 13 15:08:17 EDT 2006
Log message for revision 69449:
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.4/CHANGES.txt
U Products.Five/branches/1.4/metaconfigure.py
A Products.Five/branches/1.4/tests/classes.py
U Products.Five/branches/1.4/tests/directives.zcml
U Products.Five/branches/1.4/tests/test_directives.py
U Products.Five/branches/1.4/tests/test_security.py
-=-
Modified: Products.Five/branches/1.4/CHANGES.txt
===================================================================
--- Products.Five/branches/1.4/CHANGES.txt 2006-08-13 19:06:48 UTC (rev 69448)
+++ Products.Five/branches/1.4/CHANGES.txt 2006-08-13 19:08:16 UTC (rev 69449)
@@ -2,12 +2,14 @@
Five Changes
============
-Five 1.4.1 (unreleased)
+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
@@ -93,6 +95,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)
=======================
@@ -251,6 +269,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.4/metaconfigure.py
===================================================================
--- Products.Five/branches/1.4/metaconfigure.py 2006-08-13 19:06:48 UTC (rev 69448)
+++ Products.Five/branches/1.4/metaconfigure.py 2006-08-13 19:08:16 UTC (rev 69449)
@@ -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.4/tests/classes.py (from rev 69446, Products.Five/branches/1.3/tests/classes.py)
Modified: Products.Five/branches/1.4/tests/directives.zcml
===================================================================
--- Products.Five/branches/1.4/tests/directives.zcml 2006-08-13 19:06:48 UTC (rev 69448)
+++ Products.Five/branches/1.4/tests/directives.zcml 2006-08-13 19:08:16 UTC (rev 69449)
@@ -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.4/tests/test_directives.py
===================================================================
--- Products.Five/branches/1.4/tests/test_directives.py 2006-08-13 19:06:48 UTC (rev 69448)
+++ Products.Five/branches/1.4/tests/test_directives.py 2006-08-13 19:08:16 UTC (rev 69449)
@@ -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.4/tests/test_security.py
===================================================================
--- Products.Five/branches/1.4/tests/test_security.py 2006-08-13 19:06:48 UTC (rev 69448)
+++ Products.Five/branches/1.4/tests/test_security.py 2006-08-13 19:08:16 UTC (rev 69449)
@@ -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)
More information about the Zope-Checkins
mailing list