From 9353357dc9a0443adb8b6eb903486686e00fad67 Mon Sep 17 00:00:00 2001 From: xenofem Date: Wed, 7 Feb 2024 20:45:46 -0500 Subject: [PATCH] for alphabet ordering, blank is 0, a is 1 --- dlibrary/dlibrary.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlibrary/dlibrary.py b/dlibrary/dlibrary.py index 94a2962..f1cbf3d 100755 --- a/dlibrary/dlibrary.py +++ b/dlibrary/dlibrary.py @@ -311,7 +311,7 @@ def alphabetic_numbering(entries, start_point): ending = entry.stem[start_point:] if len(ending) > 1: return None - index = 0 if ending == '' else ord(ending.lower()) - ord('a') + index = 0 if ending == '' else ord(ending.lower()) - ord('a') + 1 if (index,) in alphabetized: return None alphabetized[(index,)] = [entry] @@ -365,7 +365,7 @@ def collate(args): cur = con.cursor() extraction_dir = args.destdir / 'extract' - hint_map = {hint.relative_to(extraction_dir).parents[-2].name: hint for hint in args.hints} + hint_map = {hint.absolute().relative_to(extraction_dir.absolute()).parents[-2].name: hint for hint in args.hints} collation_staging_area = args.destdir / 'site' / 'images-staging' collation_staging_area.mkdir(parents=True) @@ -550,7 +550,7 @@ def self_and_parents(path): return [path] + list(path.parents) def manual_collate(args): - work_id = self_and_parents(args.paths[0].relative_to(args.destdir / 'extract'))[-2].name + work_id = self_and_parents(args.paths[0].absolute().relative_to(args.destdir.absolute() / 'extract'))[-2].name collation_dir = args.destdir / 'site' / 'images' / work_id if collation_dir.exists() and len(list(collation_dir.iterdir())) > 0: