Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-04-22 19:46:54 +0000
committerGitHub <noreply@github.com>2021-04-22 19:46:54 +0000
commit1c6aa6b8f4c46d947016ae66d847c9af625dde55 (patch)
tree7fdf695e90ae4e00773a453cb673e82871bed766
parent935b878c962699cb4dc2f4ad209022de2046c7d9 (diff)
parent74951b841c9906511731408bc5d3a70a7d6ae65f (diff)
Merge pull request #339 from dylanmtaylor/patch-7
Have timezone re-prompt on invalid input
-rw-r--r--archinstall/lib/user_interaction.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index 77b3d771..dcb51e2a 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -130,17 +130,18 @@ def ask_for_additional_users(prompt='Any additional users to install (leave blan
return users, super_users
def ask_for_a_timezone():
- timezone = input('Enter a valid timezone (examples: Europe/Stockholm, US/Eastern) or press enter to use UTC: ').strip()
- if timezone == '':
- timezone = 'UTC'
- if (pathlib.Path("/usr")/"share"/"zoneinfo"/timezone).exists():
- return timezone
- else:
- log(
- f"Time zone {timezone} does not exist, continuing with system default.",
- level=LOG_LEVELS.Warning,
- fg='red'
- )
+ while True:
+ timezone = input('Enter a valid timezone (examples: Europe/Stockholm, US/Eastern) or press enter to use UTC: ').strip()
+ if timezone == '':
+ timezone = 'UTC'
+ if (pathlib.Path("/usr")/"share"/"zoneinfo"/timezone).exists():
+ return timezone
+ else:
+ log(
+ f"Specified timezone {timezone} does not exist.",
+ level=LOG_LEVELS.Warning,
+ fg='red'
+ )
def ask_for_audio_selection():
audio = "pulseaudio" # Default for most desktop environments