From a74b9f7880c76ce6bbb4619c2d6f1cb1e44b2bf4 Mon Sep 17 00:00:00 2001 From: Q Date: Tue, 30 Jul 2024 17:08:18 +0300 Subject: [PATCH] debug step --- qgpg/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qgpg/__init__.py b/qgpg/__init__.py index c88d59f..7103edb 100644 --- a/qgpg/__init__.py +++ b/qgpg/__init__.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -__version__ = "20240627.1" +__version__ = "20240730.0" import argparse import os @@ -285,6 +285,9 @@ class Processor: if os.path.isfile(root): return [root] raise ValueError("path is not a file, and no --recursive") + if recurse: + if os.path.isfile(root): + raise ValueError("path is a file, and --recursive used") filelist = [] for path, dirs, files in os.walk(root): dirs.sort() @@ -326,13 +329,13 @@ class Processor: print(f"Generated {self.opts.key} and {self.opts.key}.pub", file=sys.stderr) def process_single(self, in_file): - if self.opts.command == "encrypt": auto_path = in_file + self.suffix if self.opts.command == "decrypt": auto_path = in_file[: -len(self.suffix)] if self.opts.recursive and self.opts.out_path: out_file = os.path.join(self.opts.out_path, strip_prefix(auto_path, self.opts.path)) + print(out_file) os.makedirs(os.path.dirname(out_file), exist_ok=True) else: out_file = self.opts.out_path if self.opts.out_path else auto_path