Use pathclass.glob.

master
voussoir 2021-09-30 19:02:18 -07:00
parent d36efec25f
commit 2162f1d982
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
1 changed files with 3 additions and 4 deletions

View File

@ -1522,9 +1522,8 @@ def addfile_argparse(args):
book = Epub(args.epub) book = Epub(args.epub)
for pattern in args.files: for pattern in args.files:
for file in winglob.glob(pattern): for file in pathclass.glob(pattern, files=True):
print(f'Adding file {file}.') print(f'Adding file {file.absolute_path}.')
file = pathclass.Path(file)
try: try:
book.easy_add_file(file) book.easy_add_file(file)
except (IDExists, FileExists) as exc: except (IDExists, FileExists) as exc:
@ -1624,7 +1623,7 @@ def merge(
): ):
book = Epub.new() book = Epub.new()
input_filepaths = [pathclass.Path(p) for pattern in input_filepaths for p in winglob.glob(pattern)] input_filepaths = list(pathclass.glob_many(input_filepaths))
index_length = len(str(len(input_filepaths))) index_length = len(str(len(input_filepaths)))
rand_prefix = random_string(3, string.digits) rand_prefix = random_string(3, string.digits)