mirror of
https://github.com/greflm13/StaticGalleryBuilder.git
synced 2026-02-05 02:59:27 +00:00
packaging now working
This commit is contained in:
@@ -4,7 +4,9 @@ import argparse
|
||||
from rich_argparse import RichHelpFormatter, HelpPreviewAction
|
||||
|
||||
|
||||
DEFAULT_THEME_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "themes", "default.css")
|
||||
if __package__ == None:
|
||||
__package__ = ""
|
||||
DEFAULT_THEME_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__).removesuffix(__package__)), "templates", "default.css")
|
||||
DEFAULT_AUTHOR = "Author"
|
||||
|
||||
|
||||
@@ -41,6 +43,7 @@ class Args:
|
||||
web_root_url : str
|
||||
The base URL of the web root for the image hosting site.
|
||||
"""
|
||||
|
||||
author_name: str
|
||||
exclude_folders: List[str]
|
||||
file_extensions: List[str]
|
||||
|
||||
@@ -13,6 +13,8 @@ import modules.cclicense as cclicense
|
||||
from modules.argumentparser import Args
|
||||
|
||||
# Constants for file paths and exclusions
|
||||
if __package__ == None:
|
||||
__package__ = ""
|
||||
FAVICON_PATH = ".static/favicon.ico"
|
||||
GLOBAL_CSS_PATH = ".static/global.css"
|
||||
EXCLUDES = ["index.html", "manifest.json", "robots.txt"]
|
||||
@@ -21,7 +23,7 @@ EXCLUDES = ["index.html", "manifest.json", "robots.txt"]
|
||||
Image.MAX_IMAGE_PIXELS = 933120000
|
||||
|
||||
# Initialize Jinja2 environment for template rendering
|
||||
env = Environment(loader=FileSystemLoader(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "templates")))
|
||||
env = Environment(loader=FileSystemLoader(os.path.join(os.path.abspath(os.path.dirname(__file__).removesuffix(__package__)), "templates")))
|
||||
thumbnails: List[Tuple[str, str]] = []
|
||||
info: Dict[str, str] = {}
|
||||
pbardict: Dict[str, tqdm] = {}
|
||||
|
||||
@@ -17,11 +17,13 @@ from modules.argumentparser import Args
|
||||
from modules.css_color import css_color_to_hex, extract_theme_color, extract_colorscheme
|
||||
|
||||
# Define constants for static files directory and icon sizes
|
||||
STATIC_FILES_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "files")
|
||||
if __package__ == None:
|
||||
__package__ = ""
|
||||
STATIC_FILES_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__).removesuffix(__package__)), "files")
|
||||
ICON_SIZES = ["36x36", "48x48", "72x72", "96x96", "144x144", "192x192", "512x512"]
|
||||
|
||||
# Initialize Jinja2 environment for template rendering
|
||||
env = Environment(loader=FileSystemLoader(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "templates")))
|
||||
env = Environment(loader=FileSystemLoader(os.path.join(os.path.abspath(os.path.dirname(__file__).removesuffix(__package__)), "templates")))
|
||||
|
||||
|
||||
class Icon:
|
||||
|
||||
Reference in New Issue
Block a user