def linkableTo(self, target, name=None): if name is None: name = self.context.__name__ try: checkObject(target, name, self.context) except interface.Invalid: return False return True
def copyTo(self, target, new_name=None): obj = self.context container = obj.__parent__ orig_name = obj.__name__ if new_name is None: new_name = orig_name checkObject(target, new_name, obj) chooser = INameChooser(target) new_name = chooser.chooseName(new_name, obj) new = copy(obj) event.notify(ObjectCopiedEvent(new, obj)) target[new_name] = new return new_name
def moveTo(self, target, new_name=None): obj = self.context container = obj.__parent__ orig_name = obj.__name__ if new_name is None: new_name = orig_name checkObject(target, new_name, obj) if target is container and new_name == orig_name: return chooser = INameChooser(target) new_name = chooser.chooseName(new_name, obj) target[new_name] = removeAllProxies(obj) del container[orig_name] return new_name