From 7afe7375e104d85542f7572ca0f8559bb4e3a7fe Mon Sep 17 00:00:00 2001 From: Jabasukuriputo Wang Date: Sat, 22 Jul 2023 17:46:50 +0800 Subject: [PATCH] display a progressbar for extension installer --- modules/launch_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/launch_utils.py b/modules/launch_utils.py index 18b444d42..b827debe2 100644 --- a/modules/launch_utils.py +++ b/modules/launch_utils.py @@ -7,6 +7,7 @@ import importlib.util import platform import json from functools import lru_cache +from tqdm.auto import tqdm from modules import cmd_args, errors from modules.paths_internal import script_path, extensions_dir @@ -224,7 +225,10 @@ def run_extensions_installers(settings_file): if not os.path.isdir(extensions_dir): return - for dirname_extension in list_extensions(settings_file): + pbar_extensions = tqdm(list_extensions(settings_file), + bar_format="{desc}: |{bar}|{percentage:3.0f}% [{n_fmt}/{total_fmt} {elapsed}<{remaining}]") + for dirname_extension in pbar_extensions: + pbar_extensions.set_description("Installing %s" % dirname_extension) run_extension_installer(os.path.join(extensions_dir, dirname_extension))