[Zope-Checkins] SVN: Products.Five/branches/1.5/ Collector #2307:
ObjectCopiedEvent not dispatched to sublocations.
Stefan H. Holek
stefan at epy.co.at
Sun Jun 10 17:18:06 EDT 2007
Log message for revision 76598:
Collector #2307: ObjectCopiedEvent not dispatched to sublocations.
Changed:
U Products.Five/branches/1.5/event.zcml
U Products.Five/branches/1.5/tests/event.txt
-=-
Modified: Products.Five/branches/1.5/event.zcml
===================================================================
--- Products.Five/branches/1.5/event.zcml 2007-06-10 21:15:48 UTC (rev 76597)
+++ Products.Five/branches/1.5/event.zcml 2007-06-10 21:18:04 UTC (rev 76598)
@@ -16,4 +16,7 @@
<!-- dispatch IObjectClonedEvent with "top-down" semantics -->
<subscriber handler="OFS.subscribers.dispatchObjectClonedEvent" />
+ <!-- dispatch IObjectCopiedEvent with "top-down" semantics -->
+ <subscriber handler="OFS.subscribers.dispatchObjectCopiedEvent" />
+
</configure>
Modified: Products.Five/branches/1.5/tests/event.txt
===================================================================
--- Products.Five/branches/1.5/tests/event.txt 2007-06-10 21:15:48 UTC (rev 76597)
+++ Products.Five/branches/1.5/tests/event.txt 2007-06-10 21:18:04 UTC (rev 76598)
@@ -57,6 +57,7 @@
>>> from zope.component.interfaces import IObjectEvent, IRegistrationEvent
>>> from zope.app.container.interfaces import IObjectMovedEvent
+ >>> from zope.lifecycleevent.interfaces import IObjectCopiedEvent
>>> from OFS.interfaces import IObjectWillBeMovedEvent
>>> from OFS.interfaces import IObjectClonedEvent
>>> from OFS.interfaces import IItem
@@ -64,6 +65,7 @@
... print event.__class__.__name__, object.getId()
>>> def printObjectEventExceptSome(object, event):
... if (IObjectMovedEvent.providedBy(event) or
+ ... IObjectCopiedEvent.providedBy(event) or
... IObjectWillBeMovedEvent.providedBy(event) or
... IObjectClonedEvent.providedBy(event) or
... IRegistrationEvent.providedBy(event)):
@@ -72,6 +74,7 @@
>>> from zope.component import provideHandler
>>> provideHandler(printObjectEvent, (IItem, IObjectMovedEvent))
+ >>> provideHandler(printObjectEvent, (IItem, IObjectCopiedEvent))
>>> provideHandler(printObjectEvent, (IItem, IObjectWillBeMovedEvent))
>>> provideHandler(printObjectEvent, (IItem, IObjectClonedEvent))
>>> provideHandler(printObjectEventExceptSome, (None, IObjectEvent))
@@ -83,6 +86,7 @@
>>> zope.component.provideAdapter(OFS.subscribers.ObjectManagerSublocations)
>>> zope.component.provideHandler(OFS.subscribers.dispatchObjectWillBeMovedEvent)
>>> zope.component.provideHandler(OFS.subscribers.dispatchObjectMovedEvent)
+ >>> zope.component.provideHandler(OFS.subscribers.dispatchObjectCopiedEvent)
>>> zope.component.provideHandler(OFS.subscribers.dispatchObjectClonedEvent)
We need at least one fake deprecated method to tell the compatibility
@@ -133,6 +137,7 @@
>>> res = folder.manage_clone(folder.marine, 'tank')
ObjectCopiedEvent tank
+ ObjectCopiedEvent dog
ObjectWillBeAddedEvent tank
ObjectWillBeAddedEvent dog
ObjectAddedEvent tank
@@ -282,6 +287,7 @@
>>> res = folder.manage_clone(folder.pluto, 'mickey')
ObjectCopiedEvent mickey
+ ObjectCopiedEvent donald
ObjectWillBeAddedEvent mickey
ObjectWillBeAddedEvent donald
ObjectAddedEvent mickey
@@ -414,6 +420,7 @@
>>> res = folder.manage_clone(folder.firefly, 'serenity')
ObjectCopiedEvent serenity
+ ObjectCopiedEvent mel
ObjectWillBeAddedEvent serenity
ObjectWillBeAddedEvent mel
ObjectAddedEvent serenity
More information about the Zope-Checkins
mailing list