123456789101112131415161718192021222324252627282930313233 |
- def decrypt_execute(self):
- self.freeze_controls()
- try:
- self._cipher = EncryptionTool(
- self._file_url.get(), self._secret_key.get(), self._salt.get()
- )
- for percentage in self._cipher.decrypt():
- if self.should_cancel:
- break
- percentage = "{0:.2f}%".format(percentage)
- self._status.set(percentage)
- self.status_label.update()
- if self.should_cancel:
- self._cipher.abort()
- self._status.set("Cancellation Successful !!")
- messagebox.showinfo("EncrypC", "Cancellation Successful !!")
- self._cipher = None
- self.should_cancel = False
- self.unfreeze_controls()
- return
- self._cipher = None
- self.should_cancel = False
- self._status.set("File Decryption Successful !!")
- messagebox.showinfo("EncrypC", "File Decryption Successful !!")
- except Exception as e:
- self._status.set(e)
- self.unfreeze_controls()
|