From 7cbdff827e9852a723ac7cef6b2b7bef595b6ce8 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 8 Sep 2019 21:25:10 -0700 Subject: [PATCH] Fix calculation of merge index, after globbing. --- epubfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/epubfile.py b/epubfile.py index 06d8f10..de6a4ba 100644 --- a/epubfile.py +++ b/epubfile.py @@ -1297,11 +1297,10 @@ def holdit_argparse(args): def merge(input_filepaths, output_filename, do_headerfile=False): book = Epub.new() + input_filepaths = [pathclass.Path(p) for pattern in input_filepaths for p in glob.glob(pattern)] index_length = len(str(len(input_filepaths))) rand_prefix = random_string(3, string.digits) - input_filepaths = [pathclass.Path(p) for pattern in input_filepaths for p in glob.glob(pattern)] - for (index, input_filepath) in enumerate(input_filepaths): print(f'Merging {input_filepath.absolute_path}.') prefix = f'{rand_prefix}_{index:>0{index_length}}_{{}}'