mirror of
https://github.com/greflm13/StaticGalleryBuilder.git
synced 2026-02-05 11:09:26 +00:00
added pbar dict to better separate the progressbars
This commit is contained in:
@@ -31,7 +31,7 @@ FAVICON_PATH = ".static/favicon.ico"
|
|||||||
GLOBAL_CSS_PATH = ".static/global.css"
|
GLOBAL_CSS_PATH = ".static/global.css"
|
||||||
DEFAULT_THEME_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), "themes", "default.css")
|
DEFAULT_THEME_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), "themes", "default.css")
|
||||||
DEFAULT_AUTHOR = "Author"
|
DEFAULT_AUTHOR = "Author"
|
||||||
VERSION = "1.9.9"
|
VERSION = "1.9.10"
|
||||||
RAW_EXTENSIONS = [".3fr", ".ari", ".arw", ".bay", ".braw", ".crw", ".cr2", ".cr3", ".cap", ".data", ".dcs", ".dcr", ".dng", ".drf", ".eip", ".erf", ".fff", ".gpr", ".iiq", ".k25", ".kdc", ".mdc", ".mef", ".mos", ".mrw", ".nef", ".nrw", ".obm", ".orf", ".pef", ".ptx", ".pxn", ".r3d", ".raf", ".raw", ".rwl", ".rw2", ".rwz", ".sr2", ".srf", ".srw", ".tif", ".tiff", ".x3f"]
|
RAW_EXTENSIONS = [".3fr", ".ari", ".arw", ".bay", ".braw", ".crw", ".cr2", ".cr3", ".cap", ".data", ".dcs", ".dcr", ".dng", ".drf", ".eip", ".erf", ".fff", ".gpr", ".iiq", ".k25", ".kdc", ".mdc", ".mef", ".mos", ".mrw", ".nef", ".nrw", ".obm", ".orf", ".pef", ".ptx", ".pxn", ".r3d", ".raf", ".raw", ".rwl", ".rw2", ".rwz", ".sr2", ".srf", ".srw", ".tif", ".tiff", ".x3f"]
|
||||||
IMG_EXTENSIONS = [".jpg", ".jpeg"]
|
IMG_EXTENSIONS = [".jpg", ".jpeg"]
|
||||||
EXCLUDES = [".lock", "index.html", "manifest.json", ".sizelist.json", ".thumbnails", ".static"]
|
EXCLUDES = [".lock", "index.html", "manifest.json", ".sizelist.json", ".thumbnails", ".static"]
|
||||||
@@ -43,6 +43,7 @@ ICON_SIZES = ["36x36", "48x48", "72x72", "96x96", "144x144", "192x192", "512x512
|
|||||||
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__)), "templates")))
|
||||||
thumbnails: List[Tuple[str, str]] = []
|
thumbnails: List[Tuple[str, str]] = []
|
||||||
info: Dict[str, str] = {}
|
info: Dict[str, str] = {}
|
||||||
|
pbardict: Dict[str, tqdm] = {}
|
||||||
|
|
||||||
|
|
||||||
class Icon:
|
class Icon:
|
||||||
@@ -247,7 +248,7 @@ def list_folder(folder: str, title: str) -> None:
|
|||||||
os.mkdir(os.path.join(args.root_directory, ".thumbnails", foldername))
|
os.mkdir(os.path.join(args.root_directory, ".thumbnails", foldername))
|
||||||
contains_files = False
|
contains_files = False
|
||||||
if not args.non_interactive_mode:
|
if not args.non_interactive_mode:
|
||||||
imgpbar = tqdm(total=len(items), desc=f"Getting image info - {folder}", unit="files", ascii=True, dynamic_ncols=True)
|
pbardict[folder] = tqdm(total=len(items), desc=f"Getting image infos - {folder}", unit="files", ascii=True, dynamic_ncols=True)
|
||||||
for item in items:
|
for item in items:
|
||||||
if item not in EXCLUDES:
|
if item not in EXCLUDES:
|
||||||
if os.path.isdir(os.path.join(folder, item)):
|
if os.path.isdir(os.path.join(folder, item)):
|
||||||
@@ -302,8 +303,9 @@ def list_folder(folder: str, title: str) -> None:
|
|||||||
_info = f.read()
|
_info = f.read()
|
||||||
info[urllib.parse.quote(folder)] = _info
|
info[urllib.parse.quote(folder)] = _info
|
||||||
if not args.non_interactive_mode:
|
if not args.non_interactive_mode:
|
||||||
imgpbar.update(1)
|
pbardict[folder].update(1)
|
||||||
pbar.update(0)
|
pbar.update(0)
|
||||||
|
pbardict[folder].close()
|
||||||
sizelistfile.seek(0)
|
sizelistfile.seek(0)
|
||||||
sizelistfile.write(json.dumps(sizelist, indent=4))
|
sizelistfile.write(json.dumps(sizelist, indent=4))
|
||||||
sizelistfile.truncate()
|
sizelistfile.truncate()
|
||||||
|
|||||||
Reference in New Issue
Block a user