From 21eb9025affc1e9d81604a8633a6955f8a0caddb Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 8 Jun 2026 16:53:18 +0100 Subject: Use red/green for boolean prompts like in v4. --- src/python/console.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/python') diff --git a/src/python/console.py b/src/python/console.py index dc5c30a46..81ea37eff 100644 --- a/src/python/console.py +++ b/src/python/console.py @@ -62,7 +62,10 @@ def interactive(): # Prompts for the user to enter a boolean value. def prompt_boolean(default): while True: - answer = prompt_string("yes" if default else "no").lower() + if default: + answer = prompt_string("yes", BOLD_GREEN).lower() + else: + answer = prompt_string("no", BOLD_RED).lower() if answer in ("y", "yes"): return True if answer in ("n", "no"): @@ -71,8 +74,8 @@ def prompt_boolean(default): # Prompts for the user to enter a string value. -def prompt_string(default): - answer = input(f"[{color(default, BOLD)}] => ").strip() +def prompt_string(default, style=BOLD): + answer = input(f"[{color(default, style)}] => ").strip() print() return answer if answer else default -- cgit v1.3.1-10-gc9f91