Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/user_interaction.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib/user_interaction.py')
-rw-r--r--archinstall/lib/user_interaction.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index fdbabe96..f92cd008 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -1,10 +1,20 @@
+import getpass
from .exceptions import *
from .profiles import Profile
from .locale_helpers import search_keyboard_layout
+from .output import log
## TODO: Some inconsistencies between the selection processes.
## Some return the keys from the options, some the values?
+def get_password(prompt="Enter a password: "):
+ while (passwd := getpass.getpass(prompt)):
+ passwd_verification = getpass.getpass(prompt='And one more time for verification: ')
+ if passwd != passwd_verification:
+ log(' * Passwords did not match * ', bg='black', fg='red')
+ continue
+ return passwd
+
def generic_select(options, input_text="Select one of the above by index or absolute value: ", sort=True):
"""
A generic select function that does not output anything