From 0697bef7d5b042f56af1f00d9a97ca78145bfee5 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Fri, 10 Apr 2026 08:58:40 +0200 Subject: [PATCH] feat(input): Password prompt, rename --- commands/util/{choice.py => input_mgr.py} | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) rename commands/util/{choice.py => input_mgr.py} (72%) diff --git a/commands/util/choice.py b/commands/util/input_mgr.py similarity index 72% rename from commands/util/choice.py rename to commands/util/input_mgr.py index a03d73f..0a74b5d 100644 --- a/commands/util/choice.py +++ b/commands/util/input_mgr.py @@ -1,4 +1,6 @@ from typing import Optional +import getpass +import time def choice(default: str, options: str, msg: str) -> str: @@ -28,3 +30,17 @@ def confirm_overwrite(msg: Optional[str] = ""): return confirm( False, (msg if msg != "" else "Do you really want to overwrite your changes?") ) + + +def password(msg: str = ""): + pw = "" + if msg != "": + pw = getpass.getpass(msg) + else: + pw = getpass.getpass() + if pw != "": + return pw + else: + time.sleep(1) + print("Error: Password cannot be empty") + return password(msg)