From 9cd968b4bd77c35df3a5dad5bbef3148da08c5c5 Mon Sep 17 00:00:00 2001 From: maride Date: Fri, 2 Feb 2018 16:40:22 +0100 Subject: [PATCH] Don't enforce choices for blockdevice question --- run.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/run.py b/run.py index bb559dc..4b41c95 100755 --- a/run.py +++ b/run.py @@ -39,7 +39,7 @@ def blockdevice(termsize, settings): print("Please enter the full path to the block device the installation should take place on: (e.g. /dev/sda)") print("Make sure to choose a drive, not a partition.") print("Here's a list of devices that may be the right:") - settings["blockdevice"] = _ask("Install where?", os.listdir("/sys/block/")) + settings["blockdevice"] = _ask("Install where?", os.listdir("/sys/block/"), enforce=False) def checks(termsize, settings): @@ -138,11 +138,11 @@ def _separator(termsize): print("~" * termsize["cols"]) -def _ask(question, choices): +def _ask(question, choices, enforce=True): while True: print("=> %s (%s) " % (question, ", ".join(choices))) answer = sys.stdin.readline()[:-1] - if answer in choices: + if answer in choices or not enforce: return answer