Add status around module initialization

This commit is contained in:
Ceda EI 2024-04-07 20:10:35 +05:30
parent 55d12fdf59
commit ffe3ae76bb
1 changed files with 12 additions and 8 deletions

View File

@ -29,14 +29,18 @@ def _login_out(ctx: click.Context, login: bool):
prompts = config["inni"]["prompts"] prompts = config["inni"]["prompts"]
modules = {} modules = {}
with console.status("") as status:
for module_name in module_names: for module_name in module_names:
status.update(f"[green]Initializing {module_name}")
try: try:
module = load_module(module_name) module = load_module(module_name)
module_config = config["modules"].get(module_name, {}) module_config = config["modules"].get(module_name, {})
modules[module_name] = module(module_config) modules[module_name] = module(module_config, console, error_console)
except ModuleNotFoundError as err: except ModuleNotFoundError as err:
error_console.print(err.msg) error_console.print(err.msg)
sys.exit(0) sys.exit(0)
console.print("[green]✅ Initialized Modules")
console.print("")
variables_to_prompt = [] variables_to_prompt = []
for module in modules.values(): for module in modules.values():