index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Andreas Baumann <mail@andreasbaumann.cc> | 2022-05-28 10:36:38 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2022-05-28 10:36:38 +0200 |
commit | faf925de1882be722d2994d697a802918282e509 (patch) | |
tree | 4856c76b10b36e94875ce3c9add961960bb23bf0 /archinstall/lib/user_interaction/utils.py | |
parent | 3801bee921d22e23435c781c469d9ec0adfa00bd (diff) | |
parent | 78449f75bc44f0e2b03cb9d909b9b78e4f7ca4c8 (diff) |
-rw-r--r-- | archinstall/lib/user_interaction/utils.py | 16 |
diff --git a/archinstall/lib/user_interaction/utils.py b/archinstall/lib/user_interaction/utils.py index 48b55e8c..fa079bc2 100644 --- a/archinstall/lib/user_interaction/utils.py +++ b/archinstall/lib/user_interaction/utils.py @@ -28,12 +28,9 @@ def check_password_strong(passwd: str) -> bool: symbol_count += 40 if symbol_count**len(passwd) < 10e20: - - prompt = _("The password you are using seems to be weak,") - prompt += _("are you sure you want to use it?") - - choice = Menu(prompt, ["yes", "no"], default_option="yes").run() - return choice == "yes" + prompt = str(_("The password you are using seems to be weak, are you sure you want to use it?")) + choice = Menu(prompt, Menu.yes_no(), default_option=Menu.yes()).run() + return choice.value == Menu.yes() return True @@ -43,7 +40,6 @@ def get_password(prompt: str = '') -> Optional[str]: prompt = _("Enter a password: ") while passwd := getpass.getpass(prompt): - if len(passwd.strip()) <= 0: break @@ -56,6 +52,7 @@ def get_password(prompt: str = '') -> Optional[str]: continue return passwd + return None @@ -84,12 +81,13 @@ def do_countdown() -> bool: if SIG_TRIGGER: prompt = _('Do you really want to abort?') - choice = Menu(prompt, ['yes', 'no'], skip=False).run() - if choice == 'yes': + choice = Menu(prompt, Menu.yes_no(), skip=False).run() + if choice.value == Menu.yes(): exit(0) if SIG_TRIGGER is False: sys.stdin.read() + SIG_TRIGGER = False signal.signal(signal.SIGINT, sig_handler) |