split-secret/scripts/classes/Cleanup.py

26 lines
1.0 KiB
Python
Raw Normal View History

from .AbstractSplittedSecret import AbstractSplittedSecret
class Cleanup(AbstractSplittedSecret):
def __init__(self):
2022-12-09 13:22:57 +01:00
super(Cleanup, self).__init__()
2022-12-09 17:32:02 +01:00
self.encrypted_files_folders = [self.decrypted_password_files_folder,self.decrypted_password_files_folder]
self.decrypted_files_folders = [self.encrypted_splitted_password_files_folder,self.encrypted_password_files_folder]
def deleteAllFilesInFolder(self,folder_path):
try:
self.executeCommand('rm -v ' + folder_path + '*')
print(self.getCommandString())
print(self.getOutputString())
except:
pass
def deleteAllDecryptedFiles(self):
for folder_path in self.decrypted_files_folders:
self.deleteAllFilesInFolder(folder_path)
2022-12-09 13:22:57 +01:00
def deleteAllEncryptedFiles(self):
2022-12-09 17:32:02 +01:00
for folder_path in self.encrypted_files_folders:
self.deleteAllFilesInFolder(folder_path)
def deleteAll(self):
2022-12-09 17:32:02 +01:00
self.deleteAllEncryptedFiles()
self.deleteAllDecryptedFiles()