From 088f1d2b319e2172df47b2a41ccf1c5b572ffd9e Mon Sep 17 00:00:00 2001 From: q Date: Wed, 26 Jun 2024 11:01:53 +0300 Subject: [PATCH] make script runnable without installation --- qgpg/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qgpg/__init__.py b/qgpg/__init__.py index 952676a..3df9941 100644 --- a/qgpg/__init__.py +++ b/qgpg/__init__.py @@ -129,8 +129,7 @@ Usage ) parser.add_argument("--name", help="Name of the owner of the key", required=False, default="recipient@address") parser.add_argument( - "-r", - "--recursive", + "--recursive","-r", default=False, action="store_true", help="Recursive encryption or decryption. Processes full folder structures", @@ -277,6 +276,8 @@ class Processor: d = self.gpg.decrypt_file(fp, passphrase=self.phrase, always_trust=True) if not d.ok: print(d.status, file=sys.stderr) + if os.path.exists(out_file): + os.unlink(out_file) except KeyboardInterrupt: if os.path.exists(out_file): os.unlink(out_file)