[Zope3-checkins] CVS: Zope3/src/zope/app/container - zopecontainer.py:1.10

Sidnei da Silva sidnei@x3ng.com.br
Tue, 11 Feb 2003 13:04:46 -0500


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

Modified Files:
	zopecontainer.py 
Log Message:
Adding a test for ZopeContainerAdapter`s rename. Im almost sure that Alan had this working on the branch. The test is currently failing, which may suggest that I was wrong.

=== Zope3/src/zope/app/container/zopecontainer.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/container/zopecontainer.py:1.9	Tue Feb 11 10:59:41 2003
+++ Zope3/src/zope/app/container/zopecontainer.py	Tue Feb 11 13:04:16 2003
@@ -20,17 +20,17 @@
 from zope.app.interfaces.container import IZopeContainer
 from zope.app.interfaces.container import IOptionalNamesContainer
 from zope.app.interfaces.container import IContainerNamesContainer
-from zope.component import queryAdapter
+from zope.component import queryAdapter, getAdapter
 from zope.proxy.context import ContextWrapper
 from zope.app.event import publish
-from zope.app.event.objectevent \
-     import ObjectRemovedEvent, ObjectModifiedEvent, ObjectAddedEvent, \
-            ObjectMovedEvent
 from zope.app.interfaces.container import IAddNotifiable
 from zope.app.interfaces.container import IDeleteNotifiable
 from zope.app.interfaces.copy import IObjectMover
 from types import StringTypes
 from zope.proxy.introspection import removeAllProxies
+from zope.app.event.objectevent \
+     import ObjectRemovedEvent, ObjectModifiedEvent, ObjectAddedEvent, \
+            ObjectMovedEvent
 
 _marker = object()
 
@@ -147,7 +147,7 @@
         '''See interface IReadContainer'''
         return iter(self.context)
 
-    def rename(currentKey, newKey):
+    def rename(self, currentKey, newKey):
         """Put the object found at 'currentKey' under 'newKey' instead.
         
         The container can choose different or modified 'newKey'. The
@@ -179,10 +179,7 @@
         if mover.moveable() and mover.moveableTo(target, newKey):
 
             # the mover will call manage_beforeDelete hook for us
-
-            mover = getAdapter(object, IObjectMover)
             mover.moveTo(target, newKey)
-
             # the mover will call the manage_afterAdd hook for us
             # the mover will publish an ObjectMovedEvent for us