Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorNinchester <5041877+ninchester@users.noreply.github.com>2021-03-20 22:01:00 +0100
committerNinchester <5041877+ninchester@users.noreply.github.com>2021-03-20 22:01:00 +0100
commit42ba36b5d8ab5a8442bb4996815598ef517003a2 (patch)
treeff842e87ed98ae352605c29e9cb35bf89dc40a60 /archinstall/lib
parent6dea24ad22a84f35b3416da3440b03768a2afefe (diff)
Fix number padding based on length of the highest option index - instead of using zeroes, now spaces are used
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/user_interaction.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index e7fba747..d82068a7 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -28,7 +28,8 @@ def get_password(prompt="Enter a password: "):
return None
def print_large_list(options, padding=5, margin_bottom=0, separator=': '):
- longest_line = len(str(len(options))) + len(separator) + get_longest_option(options) + padding
+ highest_index_number_length = len(str(len(options)))
+ longest_line = highest_index_number_length + len(separator) + get_longest_option(options) + padding
max_num_of_columns = get_terminal_width() // longest_line
max_options_in_cells = max_num_of_columns * (get_terminal_height()-margin_bottom)
@@ -39,7 +40,7 @@ def print_large_list(options, padding=5, margin_bottom=0, separator=': '):
for row in range(0, (get_terminal_height()-margin_bottom)):
for column in range(row, len(options), (get_terminal_height()-margin_bottom)):
spaces = " "*(longest_line - len(options[column]))
- print(f"{str(column).zfill(2)}{separator}{options[column]}", end = spaces)
+ print(f"{str(column): >{highest_index_number_length}}{separator}{options[column]}", end = spaces)
print()
def ask_for_superuser_account(prompt='Create a required super-user with sudo privileges: ', forced=False):