[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/OFS/ Use ObjectCopiedEvent with an 'original' parameter.

Florent Guillaume fg at nuxeo.com
Mon Nov 28 10:28:49 EST 2005


Log message for revision 40389:
  Use ObjectCopiedEvent with an 'original' parameter.

Changed:
  U   Zope/branches/2.9/lib/python/OFS/CopySupport.py
  U   Zope/branches/2.9/lib/python/OFS/ObjectManager.py
  U   Zope/branches/2.9/lib/python/OFS/OrderSupport.py

-=-
Modified: Zope/branches/2.9/lib/python/OFS/CopySupport.py
===================================================================
--- Zope/branches/2.9/lib/python/OFS/CopySupport.py	2005-11-28 14:53:55 UTC (rev 40388)
+++ Zope/branches/2.9/lib/python/OFS/CopySupport.py	2005-11-28 15:28:49 UTC (rev 40389)
@@ -33,7 +33,6 @@
 from zope.event import notify
 from zope.app.event.objectevent import ObjectCopiedEvent
 from zope.app.container.contained import ObjectMovedEvent
-import Products.Five # BBB: until Zope 3.2 >= r40368 is stiched in
 from zope.app.container.contained import notifyContainerModified
 from OFS.event import ObjectWillBeMovedEvent
 from OFS.event import ObjectClonedEvent
@@ -214,9 +213,10 @@
                 id = self._get_id(orig_id)
                 result.append({'id': orig_id, 'new_id': id})
 
+                orig_ob = ob
                 ob = ob._getCopy(self)
                 ob._setId(id)
-                notify(ObjectCopiedEvent(ob))
+                notify(ObjectCopiedEvent(ob, orig_ob))
 
                 self._setObject(id, ob)
                 ob = self._getOb(id)
@@ -385,9 +385,10 @@
                 message=sys.exc_info()[1],
                 action='manage_main')
 
+        orig_ob = ob
         ob = ob._getCopy(self)
         ob._setId(id)
-        notify(ObjectCopiedEvent(ob))
+        notify(ObjectCopiedEvent(ob, orig_ob))
 
         self._setObject(id, ob)
         ob = self._getOb(id)

Modified: Zope/branches/2.9/lib/python/OFS/ObjectManager.py
===================================================================
--- Zope/branches/2.9/lib/python/OFS/ObjectManager.py	2005-11-28 14:53:55 UTC (rev 40388)
+++ Zope/branches/2.9/lib/python/OFS/ObjectManager.py	2005-11-28 15:28:49 UTC (rev 40389)
@@ -46,7 +46,6 @@
 from zope.event import notify
 from zope.app.container.contained import ObjectAddedEvent
 from zope.app.container.contained import ObjectRemovedEvent
-import Products.Five # BBB: until Zope 3.2 >= r40368 is stiched in
 from zope.app.container.contained import notifyContainerModified
 from OFS.event import ObjectWillBeAddedEvent
 from OFS.event import ObjectWillBeRemovedEvent

Modified: Zope/branches/2.9/lib/python/OFS/OrderSupport.py
===================================================================
--- Zope/branches/2.9/lib/python/OFS/OrderSupport.py	2005-11-28 14:53:55 UTC (rev 40388)
+++ Zope/branches/2.9/lib/python/OFS/OrderSupport.py	2005-11-28 15:28:49 UTC (rev 40389)
@@ -24,7 +24,6 @@
 from DocumentTemplate.sequence import sort
 from Globals import InitializeClass
 from zope.interface import implements
-import Products.Five # BBB: until Zope 3.2 >= r40368 is stiched in
 from zope.app.container.contained import notifyContainerModified
 
 from interfaces import IOrderedContainer as z3IOrderedContainer



More information about the Zope-Checkins mailing list