From eec6016737f160870de5b9bee5c68d5aeed33cca Mon Sep 17 00:00:00 2001 From: crunk Date: Sun, 17 Nov 2024 20:09:48 +0100 Subject: [PATCH] first working version since long time --- distribusi/distribusi.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/distribusi/distribusi.py b/distribusi/distribusi.py index eaef912..d811ea1 100644 --- a/distribusi/distribusi.py +++ b/distribusi/distribusi.py @@ -102,20 +102,18 @@ def check_distribusi_index(args, index): def write_index(args, index, html): with open(index, "w") as index_file: - if not args.no_template: - if args.style: - file_style = open(args.style, "r") - style = file_style.read() - styled_html_head = html_head % style - else: - styled_html_head = html_head % "" + if args.style: + file_style = open(args.style, "r") + style = file_style.read() + styled_html_head = html_head % style + else: + styled_html_head = html_head % "" index_file.write(styled_html_head) for line in html: index_file.write(line + "\n") - if not args.no_template: - index_file.write(html_footer) + index_file.write(html_footer) def handle_text_files(name, full_path, subtype): @@ -144,7 +142,7 @@ def handle_image_files(name, full_path, args): image_alttext = add_alttext(full_path) image_description = add_description(full_path) - + if not image_alttext and not image_description: return image_no_description.format( name=name, thumbnail_filename=thumbnail_filename