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:
authorAnton Hvornum <anton@hvornum.se>2021-05-22 20:50:02 +0200
committerAnton Hvornum <anton@hvornum.se>2021-05-22 20:50:02 +0200
commit1552cc82773b28b91a90f5023565538a2eb965bd (patch)
treeffc4eccb84b01bf7d2bd88f22806e631c7cb60a1 /archinstall/lib/user_interaction.py
parent78369269a0661e9aa13d26c3b688c10933765b30 (diff)
Re-worked the select_profile() user interaction. It no longer takes options as a parameter, instead it sources the profiles available, prints a curated list but allows for any input that is a valid profile.
Diffstat (limited to 'archinstall/lib/user_interaction.py')
-rw-r--r--archinstall/lib/user_interaction.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index 50c62aa9..503e9a03 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -563,28 +563,26 @@ def select_disk(dict_o_disks):
raise DiskError('select_disk() requires a non-empty dictionary of disks to select from.')
-def select_profile(options):
+def select_profile():
"""
Asks the user to select a profile from the `options` dictionary parameter.
Usually this is combined with :ref:`archinstall.list_profiles`.
- :param options: A `dict` where keys are the profile name, value should be a dict containing profile information.
- :type options: dict
-
:return: The name/dictionary key of the selected profile
:rtype: str
"""
- profiles = sorted(list(options))
+ shown_profiles = sorted(list(archinstall.list_profiles(filter_top_level_profiles=True)))
+ actual_profiles_raw = shown_profiles + sorted([profile for profile in archinstall.list_profiles() if profile not in shown_profiles])
- if len(profiles) >= 1:
- for index, profile in enumerate(profiles):
+ if len(shown_profiles) >= 1:
+ for index, profile in enumerate(shown_profiles):
print(f"{index}: {profile}")
print(' -- The above list is a set of pre-programmed profiles. --')
print(' -- They might make it easier to install things like desktop environments. --')
print(' -- (Leave blank and hit enter to skip this step and continue) --')
- selected_profile = generic_select(profiles, 'Enter a pre-programmed profile name if you want to install one: ', options_output=False)
+ selected_profile = generic_select(actual_profiles_raw, 'Enter a pre-programmed profile name if you want to install one: ', options_output=False)
if selected_profile:
return Profile(None, selected_profile)
else: