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

def zope-extfile-1.4.2::ExtFile::ExtFile::_get_ufn (   self,
  filename,
  path = None,
  content_type = None,
  lock = 1 
) [private]

If no unique filename has been generated, generate one
    otherwise, return the existing one.

Definition at line 618 of file ExtFile.py.

00618                                                                       :
        """ If no unique filename has been generated, generate one
            otherwise, return the existing one.
        """
        if UNDO_POLICY==ALWAYS_BACKUP or filename==[]: 
            new_fn = self._get_new_ufn(path=path, content_type=content_type)
        else: 
            new_fn = filename[:]
        if filename:
            old_fn = self._fsname(filename)
            if UNDO_POLICY==ALWAYS_BACKUP: 
                try: os.rename(old_fn, old_fn+'.undo')
                except OSError: pass
            else:
                try: os.rename(old_fn+'.undo', old_fn)
                except OSError: pass
        return new_fn

    def _get_new_ufn(self, path=None, content_type=None, lock=1, copy_of_re=copy_of_re):


Generated by  Doxygen 1.6.0   Back to index