refactor: rework some moonraker dialogs

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
dw-0
2024-06-22 15:57:13 +02:00
parent cfc45a9746
commit 08c10fdded

View File

@@ -25,16 +25,16 @@ def print_moonraker_overview(
headline = f"{COLOR_GREEN}The following instances were found:{RESET_FORMAT}" headline = f"{COLOR_GREEN}The following instances were found:{RESET_FORMAT}"
dialog = textwrap.dedent( dialog = textwrap.dedent(
f""" f"""
/=======================================================\\ ╔═══════════════════════════════════════════════════════╗
|{headline:^64}| {headline:^64}
|-------------------------------------------------------| ╟───────────────────────────────────────────────────────╢
""" """
)[1:] )[1:]
if show_select_all: if show_select_all:
select_all = f"{COLOR_YELLOW}a) Select all{RESET_FORMAT}" select_all = f"{COLOR_YELLOW}a) Select all{RESET_FORMAT}"
dialog += f"| {select_all:<63}|\n" dialog += f" {select_all:<63}\n"
dialog += "| |\n" dialog += " \n"
instance_map = { instance_map = {
k.get_service_file_name(): ( k.get_service_file_name(): (
@@ -49,18 +49,19 @@ def print_moonraker_overview(
mr_name = instance_map.get(k) mr_name = instance_map.get(k)
m = f"<-> {mr_name}" if mr_name != "" else "" m = f"<-> {mr_name}" if mr_name != "" else ""
line = f"{COLOR_CYAN}{f'{i})' if show_index else ''} {k} {m} {RESET_FORMAT}" line = f"{COLOR_CYAN}{f'{i})' if show_index else ''} {k} {m} {RESET_FORMAT}"
dialog += f"| {line:<63}|\n" dialog += f" {line:<63}\n"
warn_l1 = f"{COLOR_YELLOW}PLEASE NOTE: {RESET_FORMAT}" warn_l1 = f"{COLOR_YELLOW}PLEASE NOTE: {RESET_FORMAT}"
warn_l2 = f"{COLOR_YELLOW}If you select an instance with an existing Moonraker{RESET_FORMAT}" warn_l2 = f"{COLOR_YELLOW}If you select an instance with an existing Moonraker{RESET_FORMAT}"
warn_l3 = f"{COLOR_YELLOW}instance, that Moonraker instance will be re-created!{RESET_FORMAT}" warn_l3 = f"{COLOR_YELLOW}instance, that Moonraker instance will be re-created!{RESET_FORMAT}"
warning = textwrap.dedent( warning = textwrap.dedent(
f""" f"""
| |
|-------------------------------------------------------| ╟───────────────────────────────────────────────────────╢
| {warn_l1:<63}| {warn_l1:<63}
| {warn_l2:<63}| {warn_l2:<63}
| {warn_l3:<63}| {warn_l3:<63}
╟───────────────────────────────────────────────────────╢
""" """
)[1:] )[1:]