index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Daniel Girtler <blackrabbit256@gmail.com> | 2023-04-19 20:55:42 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-19 12:55:42 +0200 |
commit | 00b0ae7ba439a5a420095175b3bedd52c569db51 (patch) | |
tree | f02d081e361d5e65603f74dea3873dcc6606cf7c /archinstall/lib/user_interaction/utils.py | |
parent | 5253e57e9f26cf3e59cb2460544af13f56e485bb (diff) |
-rw-r--r-- | archinstall/lib/user_interaction/utils.py | 47 |
diff --git a/archinstall/lib/user_interaction/utils.py b/archinstall/lib/user_interaction/utils.py index 7ee6fc07..918945c0 100644 --- a/archinstall/lib/user_interaction/utils.py +++ b/archinstall/lib/user_interaction/utils.py @@ -1,13 +1,9 @@ from __future__ import annotations import getpass -import signal -import sys -import time from typing import Any, Optional, TYPE_CHECKING -from ..menu import Menu -from ..models.password_strength import PasswordStrength +from ..models import PasswordStrength from ..output import log if TYPE_CHECKING: @@ -36,44 +32,3 @@ def get_password(prompt: str = '') -> Optional[str]: return password return None - - -def do_countdown() -> bool: - SIG_TRIGGER = False - - def kill_handler(sig: int, frame: Any) -> None: - print() - exit(0) - - def sig_handler(sig: int, frame: Any) -> None: - global SIG_TRIGGER - SIG_TRIGGER = True - signal.signal(signal.SIGINT, kill_handler) - - original_sigint_handler = signal.getsignal(signal.SIGINT) - signal.signal(signal.SIGINT, sig_handler) - - for i in range(5, 0, -1): - print(f"{i}", end='') - - for x in range(4): - sys.stdout.flush() - time.sleep(0.25) - print(".", end='') - - if SIG_TRIGGER: - prompt = _('Do you really want to abort?') - 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) - - print() - signal.signal(signal.SIGINT, original_sigint_handler) - - return True |