Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSecondThundeR <awayfromgalaxy@gmail.com>2021-04-17 16:35:21 +0300
committerSecondThundeR <awayfromgalaxy@gmail.com>2021-04-17 16:35:21 +0300
commita316846121caf4b26f96bed8dbe057b649cc409d (patch)
tree259479f2a723ae9dca4e35d274f9fa0b852286a4 /examples
parent9991b19a064536defd22a7941504a4699aa906b0 (diff)
Replace input with generic_select where necessary
Here are list of changes: > From now on, `generic_select` will be called "Select function", for clarity - Slightly updated select function - Removed options output for some functions, where it's better to do with select function - Added sorting for all lists passed to select function - Replaced `dict.values()` with `dict` as options parameter - Simplified input checking for all functions that use the select function - Added temporary *(for now)* workaround for passing `?` and `help` inputs - Merged fix for `partition.format()`
Diffstat (limited to 'examples')
-rw-r--r--examples/guided.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/guided.py b/examples/guided.py
index c0d22023..89868148 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -76,7 +76,9 @@ def ask_user_questions():
archinstall.log(f" ** The root would be a simple / and the boot partition /boot (as all paths are relative inside the installation). **")
while True:
# Select a partition
- partition = archinstall.generic_select(partition_mountpoints.keys(),
+ # If we provide keys as options, it's better to convert them to list and sort before passing
+ mountpoints_list = sorted(list(partition_mountpoints.keys()))
+ partition = archinstall.generic_select(mountpoints_list,
"Select a partition by number that you want to set a mount-point for (leave blank when done): ")
if not partition:
break
@@ -106,7 +108,7 @@ def ask_user_questions():
# we have to check if we support it. We can do this by formatting /dev/null with the partitions filesystem.
# There's a nice wrapper for this on the partition object itself that supports a path-override during .format()
try:
- partition.format(new_filesystem, path='/dev/null', log_formating=False, allow_formatting=True)
+ partition.format(new_filesystem, path='/dev/null', log_formatting=False, allow_formatting=True)
except archinstall.UnknownFilesystemFormat:
archinstall.log(f"Selected filesystem is not supported yet. If you want archinstall to support '{new_filesystem}', please create a issue-ticket suggesting it on github at https://github.com/archlinux/archinstall/issues.")
archinstall.log(f"Until then, please enter another supported filesystem.")