Compare commits

...

2 Commits

Author SHA1 Message Date
Ceda EI cc7d5e4de6 Fix removing vars from variables_to_prompt 2024-04-10 02:19:56 +05:30
Ceda EI db4bd80a94 Handle Exceptions from modules 2024-04-10 00:31:28 +05:30
1 changed files with 9 additions and 5 deletions

View File

@ -62,7 +62,7 @@ def _login_out(ctx: click.Context, login: bool):
variables_to_prompt.update(
module.template_variables()["login" if login else "logout"]
)
variables_to_prompt.remove("vars")
variables_to_prompt -= {"vars"}
responses: dict[str, Any] = {
"vars": ctx.obj.get("vars", {}),
@ -74,10 +74,14 @@ def _login_out(ctx: click.Context, login: bool):
console.print(f"\n[green bold]Logging {'In' if login else 'Out'}\n")
for name, module in modules.items():
console.rule(f"[bold cyan]Module: {name}", align="left")
if login:
module.login(responses)
else:
module.logout(responses)
try:
if login:
module.login(responses)
else:
module.logout(responses)
except Exception:
error_console.print(f"[red bold]Fatal error occured running module {name}")
error_console.print_exception()
@inni.command()