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:
authorDaniel <blackrabbit256@gmail.com>2022-02-03 00:26:09 +1100
committerGitHub <noreply@github.com>2022-02-02 14:26:09 +0100
commit37d6da7e4eb8897dfb80797f28db85ccdd09d376 (patch)
treee905face839487c47a246b521bf905e47d2fb8cb /archinstall/lib/user_interaction.py
parentd3cf8a3655fe258a6291c05f94c7e3cff2a91a62 (diff)
Migrate old input to new menu (#874)
* Migrate old input to new menu * Fix imports * Remove imports * Update * Fixed import by changing 'import archinstall', to 'from ..menu import Menu' and use Menu() directly * Converted archinstall.<thing> to from ..where import <thing>. This enables us to use archinstall as a module, a git repository in testing and other things without having to install archinstall as an actual module. Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com> Co-authored-by: Anton Hvornum <anton@hvornum.se>
Diffstat (limited to 'archinstall/lib/user_interaction.py')
-rw-r--r--archinstall/lib/user_interaction.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index 34ce5534..8cc7de0a 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -79,8 +79,9 @@ def do_countdown() -> bool:
print(".", end='')
if SIG_TRIGGER:
- abort = input('\nDo you really want to abort (y/n)? ')
- if abort.strip() != 'n':
+ prompt = 'Do you really want to abort'
+ choice = Menu(prompt, ['yes', 'no'], skip=False).run()
+ if choice == 'yes':
exit(0)
if SIG_TRIGGER is False:
@@ -271,7 +272,7 @@ def ask_for_swap(prompt='Would you like to use swap on zram?', forced=False):
return False if choice == 'no' else True
-def ask_ntp():
+def ask_ntp() -> bool:
prompt = 'Would you like to use automatic time synchronization (NTP) with the default time servers?'
prompt += 'Hardware time and other post-configuration steps might be required in order for NTP to work. For more information, please check the Arch wiki'
choice = Menu(prompt, ['yes', 'no'], skip=False, default_option='yes').run()
@@ -859,7 +860,7 @@ def select_harddrives() -> Optional[str]:
return []
-def select_driver(options :Dict[str, Any] = AVAILABLE_GFX_DRIVERS) -> str:
+def select_driver(options :Dict[str, Any] = AVAILABLE_GFX_DRIVERS, force_ask :bool = False) -> str:
"""
Some what convoluted function, whose job is simple.
Select a graphics driver from a pre-defined set of popular options.
@@ -881,7 +882,7 @@ def select_driver(options :Dict[str, Any] = AVAILABLE_GFX_DRIVERS) -> str:
if has_nvidia_graphics():
title += 'For the best compatibility with your Nvidia hardware, you may want to use the Nvidia proprietary driver.\n'
- if not arguments.get('gfx_driver', None):
+ if not arguments.get('gfx_driver', None) or force_ask:
title += '\n\nSelect a graphics driver or leave blank to install all open-source drivers'
arguments['gfx_driver'] = Menu(title, drivers).run()