debug step

This commit is contained in:
Q
2024-07-30 17:08:18 +03:00
parent 36360a29d8
commit a74b9f7880

View File

@@ -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