From bb295cb83a21e104fd39e05b627403d170c2c445 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sat, 3 Apr 2021 11:25:34 +0200 Subject: Fixes #149 as well as --help. This will be added in the next patch release. --- archinstall/lib/user_interaction.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'archinstall') diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py index 80db7be1..630862ee 100644 --- a/archinstall/lib/user_interaction.py +++ b/archinstall/lib/user_interaction.py @@ -272,9 +272,16 @@ def select_language(options, show_only_country_codes=True): print(' -- You can enter ? or help to search for more languages --') selected_language = input('Select one of the above keyboard languages (by number or full name): ') if selected_language.lower() in ('?', 'help'): - filter_string = input('Search for layout containing (example: "sv-"): ') - new_options = search_keyboard_layout(filter_string) - return select_language(new_options, show_only_country_codes=False) + while True: + filter_string = input('Search for layout containing (example: "sv-"): ') + new_options = list(search_keyboard_layout(filter_string)) + + if len(new_options) <= 0: + log(f"Search string '{filter_string}' yielded no results, please try another search or Ctrl+D to abort.", fg='yellow') + continue + + return select_language(new_options, show_only_country_codes=False) + elif selected_language.isdigit() and (pos := int(selected_language)) <= len(languages)-1: selected_language = languages[pos] # I'm leaving "options" on purpose here. -- cgit v1.2.3-70-g09d2