Update user_interaction.py
This commit is contained in:
parent
935b878c96
commit
bd9d2c9125
|
|
@ -130,17 +130,19 @@ def ask_for_additional_users(prompt='Any additional users to install (leave blan
|
||||||
return users, super_users
|
return users, super_users
|
||||||
|
|
||||||
def ask_for_a_timezone():
|
def ask_for_a_timezone():
|
||||||
timezone = input('Enter a valid timezone (examples: Europe/Stockholm, US/Eastern) or press enter to use UTC: ').strip()
|
exists = False
|
||||||
if timezone == '':
|
while not exists:
|
||||||
timezone = 'UTC'
|
timezone = input('Enter a valid timezone (examples: Europe/Stockholm, US/Eastern) or press enter to use UTC: ').strip()
|
||||||
if (pathlib.Path("/usr")/"share"/"zoneinfo"/timezone).exists():
|
if timezone == '':
|
||||||
return timezone
|
timezone = 'UTC'
|
||||||
else:
|
if (pathlib.Path("/usr")/"share"/"zoneinfo"/timezone).exists():
|
||||||
log(
|
return timezone
|
||||||
f"Time zone {timezone} does not exist, continuing with system default.",
|
else:
|
||||||
level=LOG_LEVELS.Warning,
|
log(
|
||||||
fg='red'
|
f"Specified timezone {timezone} does not exist.",
|
||||||
)
|
level=LOG_LEVELS.Warning,
|
||||||
|
fg='red'
|
||||||
|
)
|
||||||
|
|
||||||
def ask_for_audio_selection():
|
def ask_for_audio_selection():
|
||||||
audio = "pulseaudio" # Default for most desktop environments
|
audio = "pulseaudio" # Default for most desktop environments
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue