Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSecondThundeR <awayfromgalaxy@gmail.com>2021-04-30 22:31:31 +0300
committerSecondThundeR <awayfromgalaxy@gmail.com>2021-04-30 22:31:31 +0300
commitefadd4a42694d87b3fe86bd7bcedf1da9a9e1773 (patch)
treeb1d0caca8b210afa0eecbd9aaafc866c96c04d0f
parentea14e860c7f730897544cb1bdb43964e25785c74 (diff)
Revert disabling default sorting
This change reverts a previous change that disabled sorting by default in the multi select function, which would be better disabled manually for pre-sorted lists than manually enabling for unsorted lists. Also, comments of the line check have been slightly changed
-rw-r--r--archinstall/lib/user_interaction.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index f06354d2..81f04db4 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -99,7 +99,7 @@ def print_large_list(options, padding=5, margin_bottom=0, separator=': '):
return column, row
-def generic_multi_select(options, text="Select one or more of the options above (leave blank to continue): ", sort=False, default=None, allow_empty=False):
+def generic_multi_select(options, text="Select one or more of the options above (leave blank to continue): ", sort=True, default=None, allow_empty=False):
# Checking if the options are different from `list` or `dict` or if they are empty
if type(options) not in [list, dict]:
log(f" * Generic multi-select doesn't support ({type(options)}) as type of options * ", fg='red')
@@ -138,8 +138,8 @@ def generic_multi_select(options, text="Select one or more of the options above
section.input_pos = section._cursor_x
selected_option = section.get_keyboard_input(end=None)
# This string check is necessary to correct work with it
- # Without this, Python can raise AttributeError because of stripping `None`
- # It also allows you to remove empty spaces if the user accidentally entered them.
+ # Without this, Python will raise AttributeError because of stripping `None`
+ # It also allows to remove empty spaces if the user accidentally entered them.
if isinstance(selected_option, str):
selected_option = selected_option.strip()
try:
@@ -715,6 +715,6 @@ def select_kernel(options):
kernels = sorted(list(options))
if kernels:
- return generic_multi_select(kernels, f"Choose which kernels to use (leave blank for default: {DEFAULT_KERNEL}): ", default=DEFAULT_KERNEL)
+ return generic_multi_select(kernels, f"Choose which kernels to use (leave blank for default: {DEFAULT_KERNEL}): ", default=DEFAULT_KERNEL, sort=False)
raise RequirementError("Selecting kernels require a least one kernel to be given as an option.")