Commit c32aa00c authored by Jim Fulton's avatar Jim Fulton

Added a manage_paste.

Made pasteFromClipboard no longer web callable.
parent c40ace88
"""Copy interface""" """Copy interface"""
__version__='$Revision: 1.9 $'[11:-2] __version__='$Revision: 1.10 $'[11:-2]
import Globals, Moniker, rPickle, tempfile import Globals, Moniker, rPickle, tempfile
from cPickle import loads, dumps from cPickle import loads, dumps
...@@ -9,8 +9,6 @@ from App.Dialogs import MessageDialog ...@@ -9,8 +9,6 @@ from App.Dialogs import MessageDialog
rPickle.register('OFS.Moniker', 'Moniker', Moniker.Moniker) rPickle.register('OFS.Moniker', 'Moniker', Moniker.Moniker)
class CopyContainer: class CopyContainer:
# Interface for containerish objects which allow # Interface for containerish objects which allow
# objects to be copied into them. # objects to be copied into them.
...@@ -29,7 +27,6 @@ class CopyContainer: ...@@ -29,7 +27,6 @@ class CopyContainer:
return v return v
def pasteFromClipboard(self,clip_id='',clip_data='',REQUEST=None): def pasteFromClipboard(self,clip_id='',clip_data='',REQUEST=None):
""" """
if not clip_data: return eNoData if not clip_data: return eNoData
try: moniker=rPickle.loads(unquote(clip_data)) try: moniker=rPickle.loads(unquote(clip_data))
...@@ -46,17 +43,19 @@ class CopyContainer: ...@@ -46,17 +43,19 @@ class CopyContainer:
obj=obj._getCopy(self) obj=obj._getCopy(self)
# Acquire roles from new environment return self.manage_paste(clip_id, obj, REQUEST)
try: del obj.__roles__
except: pass
def manage_paste(self,clip_id,obj,REQUEST=None):
""" """
obj=obj._getCopy(self)
obj._setId(clip_id) obj._setId(clip_id)
self._setObject(clip_id, obj) self._setObject(clip_id, obj)
obj._postCopy(self) obj._postCopy(self)
if REQUEST is not None:
return self.manage_main(self, REQUEST, update_menu=1) return self.manage_main(self, REQUEST, update_menu=1)
return ''
Globals.default__class_init__(CopyContainer)
class CopySource: class CopySource:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment