[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces - copypastemove.py:1.4

Sidnei da Silva sidnei@x3ng.com.br
Mon, 31 Mar 2003 09:49:11 -0500


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

Modified Files:
	copypastemove.py 
Log Message:
Refactored feature of getting a copy without children into separate adapters and interfaces. With tests :)

=== Zope3/src/zope/app/interfaces/copypastemove.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/interfaces/copypastemove.py:1.3	Sun Mar 30 10:41:00 2003
+++ Zope3/src/zope/app/interfaces/copypastemove.py	Mon Mar 31 09:48:41 2003
@@ -3,7 +3,7 @@
 class IObjectMover(Interface):
     '''Use getAdapter(obj, IObjectMover) to move an object somewhere.'''
 
-    def moveTo(target, name=None):
+    def moveTo(target, new_name=None):
         '''Move this object to the target given.
 
         Returns the new name within the target
@@ -21,7 +21,7 @@
 
 class IObjectCopier(Interface):
 
-    def copyTo(target, name=None, with_children=True):
+    def copyTo(target, new_name=None):
         """Copy this object to the target given.
 
         Returns the new name within the target, or None
@@ -31,9 +31,6 @@
         an IObjectCopied event in the context of the target container.
         If a new object is created as part of the copying process, then
         an IObjectCreated event should be published.
-
-        If with_children is true and the object is folderish, copy contents,
-        else copy just the folder.
         """
 
     def copyable():
@@ -45,6 +42,22 @@
         Returns True if it can be copied there. Otherwise, returns
         False.
         '''
+
+class INoChildrenObjectCopier(IObjectCopier):
+    """Interface for adapters that can copy an containerish object
+    without its children"""
+
+    def copyTo(target, new_name=None):
+        """Copy this object without chidren to the target given.
+
+        Returns the new name within the target, or None
+        if the target doesn't do names.
+        Typically, the target is adapted to IPasteTarget.
+        After the copy is added to the target container, publish
+        an IObjectCopied event in the context of the target container.
+        If a new object is created as part of the copying process, then
+        an IObjectCreated event should be published.
+        """
 
 class IPrincipalClipboard(Interface):
     '''Interface for adapters that store/retrieve clipboard information