From 895ac03590a3efb2322b01e9699ae2117e374277 Mon Sep 17 00:00:00 2001 From: Florian Greistorfer Date: Wed, 4 Feb 2026 08:55:30 +0100 Subject: [PATCH] fallback --- modules/argumentparser.py | 2 +- modules/generate_html.py | 2 +- modules/logger.py | 2 +- modules/svg_handling.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/argumentparser.py b/modules/argumentparser.py index de07e7f..a317866 100644 --- a/modules/argumentparser.py +++ b/modules/argumentparser.py @@ -12,7 +12,7 @@ except ModuleNotFoundError: RICH = False -SCRIPTDIR = os.path.dirname(os.path.realpath(__file__)).removesuffix(__package__) +SCRIPTDIR = os.path.dirname(os.path.realpath(__file__)).removesuffix(__package__ if __package__ else "") DEFAULT_THEME_PATH = os.path.join(SCRIPTDIR, "templates", "default.css") DEFAULT_AUTHOR = "Author" diff --git a/modules/generate_html.py b/modules/generate_html.py index 3f8a5f9..404c1c2 100644 --- a/modules/generate_html.py +++ b/modules/generate_html.py @@ -20,7 +20,7 @@ from modules.argumentparser import Args from modules.datatypes.metadata import Metadata, ImageMetadata, SubfolderMetadata # Constants for file paths and exclusions -SCRIPTDIR = os.path.dirname(os.path.realpath(__file__)).removesuffix(__package__) +SCRIPTDIR = os.path.dirname(os.path.realpath(__file__)).removesuffix(__package__ if __package__ else "") FAVICON_PATH = ".static/favicon.ico" GLOBAL_CSS_PATH = ".static/global.css" EXCLUDES = ["index.html", "manifest.json", "robots.txt"] diff --git a/modules/logger.py b/modules/logger.py index e950ad3..c13baf9 100644 --- a/modules/logger.py +++ b/modules/logger.py @@ -21,7 +21,7 @@ from datetime import datetime from pythonjsonlogger import json as jsonlogger # Constants for file paths and exclusions -SCRIPTDIR = os.path.dirname(os.path.realpath(__file__)).removesuffix(__package__) +SCRIPTDIR = os.path.dirname(os.path.realpath(__file__)).removesuffix(__package__ if __package__ else "") LOG_DIR = os.path.join(SCRIPTDIR, "logs") LATEST_LOG_FILE = os.path.join(LOG_DIR, "latest.jsonl") diff --git a/modules/svg_handling.py b/modules/svg_handling.py index 056568b..fd39773 100644 --- a/modules/svg_handling.py +++ b/modules/svg_handling.py @@ -15,10 +15,10 @@ except ImportError: from modules.logger import logger from modules.argumentparser import Args -from modules.css_color import extract_theme_color, extract_colorscheme +from modules.css_color import extract_colorscheme # Define constants for static files directory and icon sizes -SCRIPTDIR = os.path.dirname(os.path.realpath(__file__)).removesuffix(__package__) +SCRIPTDIR = os.path.dirname(os.path.realpath(__file__)).removesuffix(__package__ if __package__ else "") STATIC_FILES_DIR = os.path.join(SCRIPTDIR, "files") ICON_SIZES = ["36x36", "48x48", "72x72", "96x96", "144x144", "192x192", "512x512"]