Exemplo n.º 1
0
 def do_backup(self):
     '''
         Do a backup of the file if asked,
         and change his creation/access date
     '''
     if self.backup is False:
         mat.secure_remove(self.filename)
         os.rename(self.output, self.filename)
 def do_backup(self):
     '''
         Do a backup of the file if asked,
         and change his creation/access date
     '''
     if self.backup is False:
         mat.secure_remove(self.filename)
         os.rename(self.output, self.filename)
Exemplo n.º 3
0
 def __del__(self):
     """ Remove the files inside the temp dir,
         then remove the temp dir
     """
     for root, _, files in os.walk(self.tempdir):
         for item in files:
             path_file = os.path.join(root, item)
             mat.secure_remove(path_file)
     shutil.rmtree(self.tempdir)
Exemplo n.º 4
0
 def __del__(self):
     """ Remove the files inside the temp dir,
         then remove the temp dir
     """
     for root, _, files in os.walk(self.tempdir):
         for item in files:
             path_file = os.path.join(root, item)
             mat.secure_remove(path_file)
     shutil.rmtree(self.tempdir)
Exemplo n.º 5
0
    def do_backup(self):
        """ Keep a backup of the file if asked.

            The process of double-renaming is not very elegant,
            but it greatly simplify new strippers implementation.
        """
        if self.backup:
            shutil.move(self.filename, os.path.join(self.filename, '.bak'))
        else:
            mat.secure_remove(self.filename)
        shutil.move(self.output, self.filename)
Exemplo n.º 6
0
    def do_backup(self):
        """ Keep a backup of the file if asked.

            The process of double-renaming is not very elegant,
            but it greatly simplify new strippers implementation.
        """
        if self.backup:
            shutil.move(self.filename, self.filename + '.bak')
        else:
            mat.secure_remove(self.filename)
        shutil.move(self.output, self.filename)
Exemplo n.º 7
0
    def do_backup(self):
        '''
            Keep a backup of the file if asked.

            The process of double-renaming is not very elegant,
            but it greatly simplify new strippers implementation.
        '''
        if self.backup:
            os.rename(self.filename, self.filename + '.bak')
        else:
            mat.secure_remove(self.filename)
        os.system("mv \"" + self.output + "\" \"" + self.filename + "\"")
Exemplo n.º 8
0
 def __del__(self):
     """ Remove tempfile if it was not used
     """
     if os.path.exists(self.output):
         mat.secure_remove(self.output)
Exemplo n.º 9
0
 def __del__(self):
     """ Remove tempfile if it was not used
     """
     if os.path.exists(self.output):
         mat.secure_remove(self.output)