From ffb9a5ba5f6ec736a07d5a9fda9ca6171c0597c2 Mon Sep 17 00:00:00 2001 From: punix Date: Sun, 8 Jun 2025 00:50:21 +0200 Subject: [PATCH] in common_tools CryptUtils.decrypt() method remove check file .dat is exist in path --- Changelog | 5 +++++ common_tools.py | 36 +++++++++++++++++------------------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Changelog b/Changelog index abc8833..685dde2 100644 --- a/Changelog +++ b/Changelog @@ -5,6 +5,11 @@ Changelog for shared_libs - add Info Window for user in delete logfile bevore delete logfile. + ### Added +03-06-2025 + + - in common_tools CryptUtils.decrypt() method + remove check file .dat is exist in path. ### Added 03-06-2025 diff --git a/common_tools.py b/common_tools.py index ae495a1..483f496 100755 --- a/common_tools.py +++ b/common_tools.py @@ -21,31 +21,29 @@ class CryptoUtil: """ @staticmethod - def decrypt(user, path) -> None: + def decrypt(user) -> None: """ Starts SSL dencrypt """ - if len([file.stem for file in path.glob("*.dat")]) == 0: - pass + process: CompletedProcess[str] = run( + ["pkexec", "/usr/local/bin/ssl_decrypt.py", "--user", user], + capture_output=True, + text=True, + check=False, + ) + + # Output from Openssl Error + if process.stderr: + logging.error(process.stderr, exc_info=True) + + if process.returncode == 0: + logging.info("Files successfully decrypted...", exc_info=True) else: - process: CompletedProcess[str] = run( - ["pkexec", "/usr/local/bin/ssl_decrypt.py", "--user", user], - capture_output=True, - text=True, - check=False, + + logging.error( + f"Error process decrypt: Code {process.returncode}", exc_info=True ) - # Output from Openssl Error - if process.stderr: - logging.error(process.stderr, exc_info=True) - - if process.returncode == 0: - logging.info("Files successfully decrypted...", exc_info=True) - else: - logging.error( - f"Error process decrypt: Code {process.returncode}", exc_info=True - ) - @staticmethod def encrypt(user) -> None: """ -- 2.49.0