for alphabet ordering, blank is 0, a is 1

main
xenofem 2024-02-07 20:45:46 -05:00
parent 2d1add4f3e
commit 9353357dc9
1 changed files with 3 additions and 3 deletions

View File

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