[Zope-CVS] CVS: Packages/Moztop/moztopsupport/dav - copy.py:1.4

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


Update of /cvs-repository/Packages/Moztop/moztopsupport/dav
In directory cvs.zope.org:/tmp/cvs-serv19600/moztopsupport/dav

Modified Files:
	copy.py 
Log Message:
Adapting to the changes I did on Zope3.

=== Packages/Moztop/moztopsupport/dav/copy.py 1.3 => 1.4 ===
--- Packages/Moztop/moztopsupport/dav/copy.py:1.3	Sun Mar 30 10:32:01 2003
+++ Packages/Moztop/moztopsupport/dav/copy.py	Mon Mar 31 09:52:30 2003
@@ -16,7 +16,7 @@
 __metaclass__ = type
 
 from zope.component import queryAdapter, getAdapter, getView
-from zope.app.interfaces.copypastemove import IObjectCopier
+from zope.app.interfaces.copypastemove import IObjectCopier, INoChildrenObjectCopier
 from zope.app.traversing import getRoot, traverse, joinPath
 from zope.app.interfaces.container import IReadContainer
 
@@ -76,12 +76,13 @@
         target_path = '/'.join(target[:-1])
         obj_name = target[-1]
         dest = traverse(root, target_path)
-        
-        copier = queryAdapter(self.context, IObjectCopier, None)
+
+        copy_iface = with_children and IObjectCopier or INoChildrenObjectCopier
+        copier = queryAdapter(self.context, copy_iface, None)
         if copier is None:
             request.response.setStatus(403)
             return ''
-        copier.copyTo(dest, obj_name, with_children=with_children)
+        copier.copyTo(dest, obj_name)
         request.response.setStatus(201)
         if depth != '0':
             if IReadContainer.isImplementedBy(context):