[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container - contents.py:1.7.2.2

Sidnei da Silva sidnei@x3ng.com.br
Wed, 5 Feb 2003 08:08:19 -0500


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

Modified Files:
      Tag: paris-copypasterename-branch
	contents.py 
Log Message:
Yay! Copy and Paste works! Move is breaking the pasted object. :(

=== Zope3/src/zope/app/browser/container/contents.py 1.7.2.1 => 1.7.2.2 ===
--- Zope3/src/zope/app/browser/container/contents.py:1.7.2.1	Wed Feb  5 07:42:57 2003
+++ Zope3/src/zope/app/browser/container/contents.py	Wed Feb  5 08:08:17 2003
@@ -85,6 +85,7 @@
         annotationsvc = getService(self.context, 'PrincipalAnnotation')
         annotations = annotationsvc.getAnnotation(user)
         clipboard = getAdapter(annotations, IPrincipalClipboard)
+        clipboard.clearContents()
         items = []
         for id in ids:
             items.append('%s/%s' % ('/'.join(container_path), id))
@@ -101,6 +102,7 @@
         annotationsvc = getService(self.context, 'PrincipalAnnotation')
         annotations = annotationsvc.getAnnotation(user)
         clipboard = getAdapter(annotations, IPrincipalClipboard)
+        clipboard.clearContents()
         items = []
         for id in ids:
             items.append('%s/%s' % ('/'.join(container_path), id))
@@ -111,11 +113,9 @@
     def pasteObjects(self):
         '''Iterate over clipboard contents and perform the move/copy operations'''
         container = self.context
+        target = container
         physical = getAdapter(container, IPhysicallyLocatable)
         container_path = physical.getPhysicalPath()
-        root = getPhysicalRoot(container)
-        container = traverse(root, container_path)
-        target = getAdapter(container, IPasteTarget)
 
         user = self.request.user
         annotationsvc = getService(self.context, 'PrincipalAnnotation')
@@ -130,7 +130,7 @@
                 getAdapter(obj, IObjectCopier).copyTo(target)
             else:
                 raise
-        
+
         self.request.response.redirect('@@contents.html')
 
     def listContentInfo(self):