index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton.feeds+github@gmail.com> | 2020-09-29 22:09:28 +0000 |
---|---|---|
committer | Anton Hvornum <anton.feeds+github@gmail.com> | 2020-09-29 22:09:28 +0000 |
commit | f8963421479858ff68568f1bf492cf867e1a25aa (patch) | |
tree | df56d30a51dbbefe8742e2886b495dc6fc349e3a /archinstall/lib | |
parent | 6338e7116ef5405cd9b97f066e45a89b7d8e67e7 (diff) |
-rw-r--r-- | archinstall/lib/user_interaction.py | 27 |
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py index 9f939f12..905962c9 100644 --- a/archinstall/lib/user_interaction.py +++ b/archinstall/lib/user_interaction.py @@ -17,6 +17,33 @@ def select_disk(dict_o_disks): raise DiskError('select_disk() requires a non-empty dictionary of disks to select from.') +def select_profile(options): + profiles = sorted(list(options)) + + if len(profiles) >= 1: + for index, profile in enumerate(profiles): + print(f"{index}: {profile}") + + print(' -- The above list is pre-programmed profiles. --') + print(' -- They might make it easier to install things like desktop environments. --') + print(' -- (Leave blank to skip this next optional step) --') + selected_profile = input('Any particular pre-programmed profile you want to install: ') + + #print(' -- You can enter ? or help to search for more profiles --') + #if selected_profile.lower() in ('?', 'help'): + # filter_string = input('Search for layout containing (example: "sv-"): ') + # new_options = search_keyboard_layout(filter_string) + # return select_language(new_options) + if selected_profile.isdigit() and (pos := int(selected_profile)) <= len(profiles)-1: + selected_profile = profiles[pos] + elif selected_profile in options: + selected_profile = options[options.index(selected_profile)] + else: + RequirementError("Selected profile does not exist.") + return selected_profile + + raise RequirementError("Selecting profiles require a least one profile to be given as an option.") + def select_language(options, show_only_country_codes=True): if show_only_country_codes: languages = sorted([language for language in list(options) if len(language) == 2]) |