[Zope3-checkins] CVS: Zope3/src/zope/app/container - copypastemove.py:1.2 zopecontainer.py:1.13

Guido van Rossum guido@python.org
Wed, 26 Feb 2003 11:12:06 -0500


Update of /cvs-repository/Zope3/src/zope/app/container
In directory cvs.zope.org:/tmp/cvs-serv30716/src/zope/app/container

Modified Files:
	copypastemove.py zopecontainer.py 
Log Message:
Rename manage_afterAdd and manage_beforeDelete to afterAddHook and
beforeDeleteHook.  Patch contributed by Christian Heimes.


=== Zope3/src/zope/app/container/copypastemove.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/container/copypastemove.py:1.1	Mon Feb 17 10:10:39 2003
+++ Zope3/src/zope/app/container/copypastemove.py	Wed Feb 26 11:11:35 2003
@@ -64,7 +64,7 @@
         given key.
         
         This method must not issue an IObjectAddedEvent, nor must it
-        call the manage_afterAdd hook of the object.
+        call the afterAddHook method of the object.
         However, it must publish an IObjectModified event for the
         container.
         '''
@@ -107,7 +107,7 @@
         
         movingTo is the unicode path for where the move is to.
         This method should not publish an IObjectRemovedEvent, nor should
-        it call the manage_afterDelete method of the object.
+        it call the afterDeleteHook method of the object.
         However, it must publish an IObjectModified event for the
         container.
         '''


=== Zope3/src/zope/app/container/zopecontainer.py 1.12 => 1.13 ===
--- Zope3/src/zope/app/container/zopecontainer.py:1.12	Mon Feb 17 10:10:39 2003
+++ Zope3/src/zope/app/container/zopecontainer.py	Wed Feb 26 11:11:35 2003
@@ -115,7 +115,7 @@
         # Call the after add hook, if necessary
         adapter = queryAdapter(object, IAddNotifiable)
         if adapter is not None:
-            adapter.manage_afterAdd(object, container)
+            adapter.afterAddHook(object, container)
 
         publish(container, ObjectModifiedEvent(container))
         return key
@@ -130,11 +130,11 @@
         # Call the before delete hook, if necessary
         adapter = queryAdapter(object, IDeleteNotifiable)
         if adapter is not None:
-            adapter.manage_beforeDelete(object, container)
-        elif hasattr(object, 'manage_beforeDelete'):
+            adapter.beforeDeleteHook(object, container)
+        elif hasattr(object, 'beforeDeleteHook'):
             # XXX: Ideally, only do this in debug mode.
             from warnings import warn
-            warn('Class %s has manage_beforeDelete but is not'
+            warn('Class %s has beforeDeleteHook but is not'
                  ' IDeleteNotifiable' % object.__class__)
 
         del container[key]
@@ -155,18 +155,18 @@
         'newKey' that was used is returned.
         
         If the object at 'currentKey' is IMoveNotifiable, its
-        manage_beforeDelete method is called, with a movingTo
+        beforeDeleteHook method is called, with a movingTo
         argument of the container's path plus the 'newKey'.
         Otherwise, if the object at 'currentKey' is IDeleteNotifiable,
-        its manage_beforeDelete method is called.
+        its beforeDeleteHook method is called.
         
         Then, the object is removed from the container using the
         container's __del__ method.
         
-        Then, If the object is IMoveNotifiable, its manage_afterAdd
+        Then, If the object is IMoveNotifiable, its afterAddHook
         method is called, with a movedFrom argument of the container's
         path plus the 'currentKey'.
-        Otherwise, if the object is IAddNotifiable, its manage_afterAdd
+        Otherwise, if the object is IAddNotifiable, its afterAddHook
         method is called.
         
         Then, an IObjectMovedEvent is published.
@@ -183,9 +183,9 @@
 
         if mover.moveable() and mover.moveableTo(target, newKey):
 
-            # the mover will call manage_beforeDelete hook for us
+            # the mover will call beforeDeleteHook hook for us
             mover.moveTo(target, newKey)
-            # the mover will call the manage_afterAdd hook for us
+            # the mover will call the afterAddHook hook for us
             # the mover will publish an ObjectMovedEvent for us