[Zope3-checkins] CVS: Zope3/src/zope/app/container - copy.py:1.1.2.4 zopecontainer.py:1.8.2.2
Sidnei da Silva
sidnei@x3ng.com.br
Tue, 4 Feb 2003 11:02:48 -0500
Update of /cvs-repository/Zope3/src/zope/app/container
In directory cvs.zope.org:/tmp/cvs-serv3317/src/zope/app/container
Modified Files:
Tag: paris-copypasterename-branch
copy.py zopecontainer.py
Log Message:
Fixing some typos here and there
=== Zope3/src/zope/app/container/copy.py 1.1.2.3 => 1.1.2.4 ===
--- Zope3/src/zope/app/container/copy.py:1.1.2.3 Tue Feb 4 10:42:16 2003
+++ Zope3/src/zope/app/container/copy.py Tue Feb 4 11:02:16 2003
@@ -1,3 +1,22 @@
+##############################################################################
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+Revision information:
+$Id$
+"""
+
from zope.app.interfaces.container import IPasteTarget
from zope.proxy.introspection import removeAllProxies
from zope.app.event.objectevent import ObjectModifiedEvent
@@ -11,7 +30,7 @@
def __init__(self, container):
self.context = container
- def acceptsObject(key, obj):
+ def acceptsObject(self, key, obj):
'''Allow the container to say if it accepts the given wrapped
object.
@@ -24,7 +43,7 @@
return True
- def pasteObject(key, obj):
+ def pasteObject(self, key, obj):
'''Add the given object to the container under the given key.
Raises a ValueError if key is an empty string, unless the
@@ -66,7 +85,7 @@
def __init__(self, container):
self.context = container
- def removeObject(key, movingTo):
+ def removeObject(self, key, movingTo):
'''Remove and return the object with the given key, as the
first part of a move.
@@ -94,7 +113,7 @@
def __init__(self, container):
self.context = container
- def copyObject(key, copyingTo):
+ def copyObject(self, key, copyingTo):
'''Return the object with the given key, as the first part of a
copy.
=== Zope3/src/zope/app/container/zopecontainer.py 1.8.2.1 => 1.8.2.2 ===
--- Zope3/src/zope/app/container/zopecontainer.py:1.8.2.1 Tue Feb 4 06:46:42 2003
+++ Zope3/src/zope/app/container/zopecontainer.py Tue Feb 4 11:02:16 2003
@@ -28,12 +28,8 @@
ObjectMovedEvent
from zope.app.interfaces.container import IAddNotifiable
from zope.app.interfaces.container import IDeleteNotifiable
-from zope.app.interfaces.container import IMoveNotifiable
-from zope.app.interfaces.container import IMoveSource
-from zope.app.interfaces.container import IPasteTarget
from zope.app.interfaces.container import IContainerCopyPasteMoveSupport
from zope.app.interfaces.copy import IObjectMover
-from zope.app.interfaces.traversing import IPhysicallyLocatable
from types import StringTypes
from zope.proxy.introspection import removeAllProxies
@@ -179,25 +175,17 @@
object = self.get(currentKey)
mover = getAdapter(object, IObjectMover)
container = self.context
- target = getAdapter(container, IPasteTarget)
-
+ target = container
+
if mover.moveable() and mover.moveableTo(target, newKey):
- physical = getAdapter(container, IPhysicallyLocatable)
- target_path = physical.getPhysicalPath()
- if queryAdapter(object, IMoveNotifiable):
- object.manage_beforeDelete(object, container, \
- movingTo=target_path)
- elif queryAdapter(object, IDeleteNotifiable):
- object.manage_beforeDelete(object, container)
-
- source = getAdapter(container, IMoveSource)
- object = source.removeObject(currentKey, target_path)
+ # the mover will call manage_beforeDelete hook for us
mover = getAdapter(object, IObjectMover)
mover.moveTo(target, newKey)
-
- publish(container, ObjectMovedEvent(object))
+
+ # the mover will call the manage_afterAdd hook for us
+ # the mover will publish an ObjectMovedEvent for us