Log message for revision 78509:
  Restored fix for #2307 by merging from 1.4-objectcopiedeventdispatcher branch.
  

Changed:
  U   Products.Five/branches/1.4/event.zcml
  U   Products.Five/branches/1.4/tests/event.txt

-=-
Modified: Products.Five/branches/1.4/event.zcml
===================================================================
--- Products.Five/branches/1.4/event.zcml       2007-07-31 22:43:53 UTC (rev 
78508)
+++ Products.Five/branches/1.4/event.zcml       2007-07-31 22:52:38 UTC (rev 
78509)
@@ -33,4 +33,12 @@
       handler="OFS.subscribers.dispatchObjectClonedEvent"
       />
 
+  <!-- dispatch IObjectCopiedEvent with "top-down" semantics -->
+
+  <subscriber
+      for="OFS.interfaces.IItem
+           zope.app.event.interfaces.IObjectCopiedEvent"
+      handler="OFS.subscribers.dispatchObjectCopiedEvent"
+      />
+
 </configure>

Modified: Products.Five/branches/1.4/tests/event.txt
===================================================================
--- Products.Five/branches/1.4/tests/event.txt  2007-07-31 22:43:53 UTC (rev 
78508)
+++ Products.Five/branches/1.4/tests/event.txt  2007-07-31 22:52:38 UTC (rev 
78509)
@@ -60,6 +60,7 @@
 
   >>> from zope.app.event.interfaces import IObjectEvent
   >>> from zope.app.container.interfaces import IObjectMovedEvent
+  >>> from zope.app.event.interfaces import IObjectCopiedEvent
   >>> from OFS.interfaces import IObjectWillBeMovedEvent
   >>> from OFS.interfaces import IObjectClonedEvent
   >>> from OFS.interfaces import IItem
@@ -67,6 +68,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)):
   ...         return
@@ -74,6 +76,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))
@@ -134,6 +137,7 @@
 
   >>> res = folder.manage_clone(folder.marine, 'tank')
   ObjectCopiedEvent tank
+  ObjectCopiedEvent dog
   ObjectWillBeAddedEvent tank
   ObjectWillBeAddedEvent dog
   ObjectAddedEvent tank
@@ -283,6 +287,7 @@
 
   >>> res = folder.manage_clone(folder.pluto, 'mickey')
   ObjectCopiedEvent mickey
+  ObjectCopiedEvent donald
   ObjectWillBeAddedEvent mickey
   ObjectWillBeAddedEvent donald
   ObjectAddedEvent mickey
@@ -415,6 +420,7 @@
 
   >>> res = folder.manage_clone(folder.firefly, 'serenity')
   ObjectCopiedEvent serenity
+  ObjectCopiedEvent mel
   ObjectWillBeAddedEvent serenity
   ObjectWillBeAddedEvent mel
   ObjectAddedEvent serenity

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to