Logo Search packages:      
Sourcecode: zope-extfile version File versions

def zope-extfile-1.4.2::ExtImage::ExtImage::manage_beforeDelete (   self,
  item,
  container 
)

This method is called, when the object is deleted. To support 
    undo-functionality and because this happens too, when the object 
    is moved (cut-paste) or renamed, the external file is not deleted. 
    It is just renamed to filename.undo and remains in the 
    repository, until it is deleted manually.

Definition at line 575 of file ExtImage.py.

00575                                                   :
        """ This method is called, when the object is deleted. To support 
            undo-functionality and because this happens too, when the object 
            is moved (cut-paste) or renamed, the external file is not deleted. 
            It is just renamed to filename.undo and remains in the 
            repository, until it is deleted manually.
        """
        if self.has_preview and self.filename != self.prev_filename:
            tmp_fn = self._temp_fsname(self.prev_filename)
            fn = self._fsname(self.prev_filename)
            if isfile(tmp_fn):
                try: os.rename(tmp_fn, fn+'.undo')
                except OSError: pass
                else:
                    try: os.remove(fn)
                    except OSError: pass
            elif isfile(fn):
                try: os.rename(fn, fn+'.undo')
                except OSError: pass
        return ExtImage.inheritedAttribute("manage_beforeDelete")(self, item, container)

    ################################


Generated by  Doxygen 1.6.0   Back to index