mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-24 16:23:36 +05:00
refactor: make menus more visually appealing
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -56,20 +56,21 @@ class KlipperRemoveMenu(BaseMenu):
|
||||
o4 = checked if self.delete_klipper_logs else unchecked
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| Enter a number and hit enter to select / deselect |
|
||||
| the specific option for removal. |
|
||||
|-------------------------------------------------------|
|
||||
| 0) Select everything |
|
||||
|-------------------------------------------------------|
|
||||
| 1) {o1} Remove Service |
|
||||
| 2) {o2} Remove Local Repository |
|
||||
| 3) {o3} Remove Python Environment |
|
||||
| 4) {o4} Delete all Log-Files |
|
||||
|-------------------------------------------------------|
|
||||
| C) Continue |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ Enter a number and hit enter to select / deselect ║
|
||||
║ the specific option for removal. ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ 0) Select everything ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ 1) {o1} Remove Service ║
|
||||
║ 2) {o2} Remove Local Repository ║
|
||||
║ 3) {o3} Remove Python Environment ║
|
||||
║ 4) {o4} Delete all Log-Files ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ C) Continue ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
|
||||
@@ -57,11 +57,11 @@ class KlipperBuildFirmwareMenu(BaseMenu):
|
||||
count = 62 - len(color) - len(RESET_FORMAT)
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| The following dependencies are required: |
|
||||
| |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ The following dependencies are required: ║
|
||||
║ ║
|
||||
"""
|
||||
)[1:]
|
||||
|
||||
@@ -71,15 +71,15 @@ class KlipperBuildFirmwareMenu(BaseMenu):
|
||||
status = status_missing if d in self.missing_deps else status_ok
|
||||
padding = 39 - len(d) + len(status) + (len(status_ok) - len(status))
|
||||
d = f" {COLOR_CYAN}● {d}{RESET_FORMAT}"
|
||||
menu += f"| {d}{status:>{padding}} |\n"
|
||||
menu += f"║ {d}{status:>{padding}} ║\n"
|
||||
menu += "║ ║\n"
|
||||
|
||||
menu += "| |\n"
|
||||
if len(self.missing_deps) == 0:
|
||||
line = f"{COLOR_GREEN}All dependencies are met!{RESET_FORMAT}"
|
||||
else:
|
||||
line = f"{COLOR_RED}Dependencies are missing!{RESET_FORMAT}"
|
||||
|
||||
menu += f"| {line:<62} |\n"
|
||||
menu += f"║ {line:<62} ║\n"
|
||||
|
||||
print(menu, end="")
|
||||
|
||||
|
||||
@@ -39,22 +39,22 @@ class KlipperNoFirmwareErrorMenu(BaseMenu):
|
||||
line1 = f"{color}Unable to find a compiled firmware file!{RESET_FORMAT}"
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| {line1:<62} |
|
||||
| |
|
||||
| Make sure, that: |
|
||||
| ● the folder '~/klipper/out' and its content exist |
|
||||
| ● the folder contains the following file: |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ {line1:<62} ║
|
||||
║ ║
|
||||
║ Make sure, that: ║
|
||||
║ ● the folder '~/klipper/out' and its content exist ║
|
||||
║ ● the folder contains the following file: ║
|
||||
"""
|
||||
)[1:]
|
||||
|
||||
if self.flash_options.flash_method is FlashMethod.REGULAR:
|
||||
menu += "| ● 'klipper.elf' |\n"
|
||||
menu += "| ● 'klipper.elf.hex' |\n"
|
||||
menu += "║ ● 'klipper.elf' ║\n"
|
||||
menu += "║ ● 'klipper.elf.hex' ║\n"
|
||||
else:
|
||||
menu += "| ● 'klipper.bin' |\n"
|
||||
menu += "║ ● 'klipper.bin' ║\n"
|
||||
|
||||
print(menu, end="")
|
||||
|
||||
@@ -86,19 +86,19 @@ class KlipperNoBoardTypesErrorMenu(BaseMenu):
|
||||
line1 = f"{color}Reading the list of supported boards failed!{RESET_FORMAT}"
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| {line1:<62} |
|
||||
| |
|
||||
| Make sure, that: |
|
||||
| ● the folder '~/klipper' and all its content exist |
|
||||
| ● the content of folder '~/klipper' is not currupted |
|
||||
| ● the file '~/klipper/scripts/flash-sd.py' exist |
|
||||
| ● your current user has access to those files/folders |
|
||||
| |
|
||||
| If in doubt or this process continues to fail, please |
|
||||
| consider to download Klipper again. |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ {line1:<62} ║
|
||||
║ ║
|
||||
║ Make sure, that: ║
|
||||
║ ● the folder '~/klipper' and all its content exist ║
|
||||
║ ● the content of folder '~/klipper' is not currupted ║
|
||||
║ ● the file '~/klipper/scripts/flash-sd.py' exist ║
|
||||
║ ● your current user has access to those files/folders ║
|
||||
║ ║
|
||||
║ If in doubt or this process continues to fail, please ║
|
||||
║ consider to download Klipper again. ║
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
|
||||
@@ -39,32 +39,33 @@ class KlipperFlashMethodHelpMenu(BaseMenu):
|
||||
subheader2 = f"{COLOR_CYAN}Updating via SD-Card Update:{RESET_FORMAT}"
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| {subheader1:<62} |
|
||||
| The default method to flash controller boards which |
|
||||
| are connected and updated over USB and not by placing |
|
||||
| a compiled firmware file onto an internal SD-Card. |
|
||||
| |
|
||||
| Common controllers that get flashed that way are: |
|
||||
| - Arduino Mega 2560 |
|
||||
| - Fysetc F6 / S6 (used without a Display + SD-Slot) |
|
||||
| |
|
||||
| {subheader2:<62} |
|
||||
| Many popular controller boards ship with a bootloader |
|
||||
| capable of updating the firmware via SD-Card. |
|
||||
| Choose this method if your controller board supports |
|
||||
| this way of updating. This method ONLY works for up- |
|
||||
| grading firmware. The initial flashing procedure must |
|
||||
| be done manually per the instructions that apply to |
|
||||
| your controller board. |
|
||||
| |
|
||||
| Common controllers that can be flashed that way are: |
|
||||
| - BigTreeTech SKR 1.3 / 1.4 (Turbo) / E3 / Mini E3 |
|
||||
| - Fysetc F6 / S6 (used with a Display + SD-Slot) |
|
||||
| - Fysetc Spider |
|
||||
| |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ {subheader1:<62} ║
|
||||
║ The default method to flash controller boards which ║
|
||||
║ are connected and updated over USB and not by placing ║
|
||||
║ a compiled firmware file onto an internal SD-Card. ║
|
||||
║ ║
|
||||
║ Common controllers that get flashed that way are: ║
|
||||
║ - Arduino Mega 2560 ║
|
||||
║ - Fysetc F6 / S6 (used without a Display + SD-Slot) ║
|
||||
║ ║
|
||||
║ {subheader2:<62} ║
|
||||
║ Many popular controller boards ship with a bootloader ║
|
||||
║ capable of updating the firmware via SD-Card. ║
|
||||
║ Choose this method if your controller board supports ║
|
||||
║ this way of updating. This method ONLY works for up- ║
|
||||
║ grading firmware. The initial flashing procedure must ║
|
||||
║ be done manually per the instructions that apply to ║
|
||||
║ your controller board. ║
|
||||
║ ║
|
||||
║ Common controllers that can be flashed that way are: ║
|
||||
║ - BigTreeTech SKR 1.3 / 1.4 (Turbo) / E3 / Mini E3 ║
|
||||
║ - Fysetc F6 / S6 (used with a Display + SD-Slot) ║
|
||||
║ - Fysetc Spider ║
|
||||
║ ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
@@ -96,19 +97,19 @@ class KlipperFlashCommandHelpMenu(BaseMenu):
|
||||
subheader2 = f"{COLOR_CYAN}make serialflash:{RESET_FORMAT}"
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| {subheader1:<62} |
|
||||
| The default command to flash controller board, it |
|
||||
| will detect selected microcontroller and use suitable |
|
||||
| tool for flashing it. |
|
||||
| |
|
||||
| {subheader2:<62} |
|
||||
| Special command to flash STM32 microcontrollers in |
|
||||
| DFU mode but connected via serial. stm32flash command |
|
||||
| will be used internally. |
|
||||
| |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ {subheader1:<62} ║
|
||||
║ The default command to flash controller board, it ║
|
||||
║ will detect selected microcontroller and use suitable ║
|
||||
║ tool for flashing it. ║
|
||||
║ ║
|
||||
║ {subheader2:<62} ║
|
||||
║ Special command to flash STM32 microcontrollers in ║
|
||||
║ DFU mode but connected via serial. stm32flash command ║
|
||||
║ will be used internally. ║
|
||||
║ ║
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
@@ -142,25 +143,26 @@ class KlipperMcuConnectionHelpMenu(BaseMenu):
|
||||
subheader2 = f"{COLOR_CYAN}UART:{RESET_FORMAT}"
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| {subheader1:<62} |
|
||||
| Selecting USB as the connection method will scan the |
|
||||
| USB ports for connected controller boards. This will |
|
||||
| be similar to the 'ls /dev/serial/by-id/*' command |
|
||||
| suggested by the official Klipper documentation for |
|
||||
| determining successfull USB connections! |
|
||||
| |
|
||||
| {subheader2:<62} |
|
||||
| Selecting UART as the connection method will list all |
|
||||
| possible UART serial ports. Note: This method ALWAYS |
|
||||
| returns something as it seems impossible to determine |
|
||||
| if a valid Klipper controller board is connected or |
|
||||
| not. Because of that, you MUST know which UART serial |
|
||||
| port your controller board is connected to when using |
|
||||
| this connection method. |
|
||||
| |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ {subheader1:<62} ║
|
||||
║ Selecting USB as the connection method will scan the ║
|
||||
║ USB ports for connected controller boards. This will ║
|
||||
║ be similar to the 'ls /dev/serial/by-id/*' command ║
|
||||
║ suggested by the official Klipper documentation for ║
|
||||
║ determining successfull USB connections! ║
|
||||
║ ║
|
||||
║ {subheader2:<62} ║
|
||||
║ Selecting UART as the connection method will list all ║
|
||||
║ possible UART serial ports. Note: This method ALWAYS ║
|
||||
║ returns something as it seems impossible to determine ║
|
||||
║ if a valid Klipper controller board is connected or ║
|
||||
║ not. Because of that, you MUST know which UART serial ║
|
||||
║ port your controller board is connected to when using ║
|
||||
║ this connection method. ║
|
||||
║ ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
|
||||
@@ -38,7 +38,7 @@ from core.menus import FooterType, Option
|
||||
from core.menus.base_menu import BaseMenu
|
||||
from utils.constants import COLOR_CYAN, COLOR_RED, COLOR_YELLOW, RESET_FORMAT
|
||||
from utils.input_utils import get_number_input
|
||||
from utils.logger import Logger
|
||||
from utils.logger import DialogType, Logger
|
||||
|
||||
|
||||
# noinspection PyUnusedLocal
|
||||
@@ -74,19 +74,18 @@ class KlipperFlashMethodMenu(BaseMenu):
|
||||
count = 62 - len(color) - len(RESET_FORMAT)
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| Select the flash method for flashing the MCU. |
|
||||
| |
|
||||
| {subheader:<62} |
|
||||
| {subline1:<62} |
|
||||
| {subline2:<62} |
|
||||
|-------------------------------------------------------|
|
||||
| |
|
||||
| 1) Regular flashing method |
|
||||
| 2) Updating via SD-Card Update |
|
||||
| |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ Select the flash method for flashing the MCU. ║
|
||||
║ ║
|
||||
║ {subheader:<62} ║
|
||||
║ {subline1:<62} ║
|
||||
║ {subline2:<62} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ 1) Regular flashing method ║
|
||||
║ 2) Updating via SD-Card Update ║
|
||||
╟───────────────────────────┬───────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
@@ -131,12 +130,12 @@ class KlipperFlashCommandMenu(BaseMenu):
|
||||
def print_menu(self) -> None:
|
||||
menu = textwrap.dedent(
|
||||
"""
|
||||
/=======================================================\\
|
||||
| |
|
||||
| Which flash command to use for flashing the MCU? |
|
||||
| 1) make flash (default) |
|
||||
| 2) make serialflash (stm32flash) |
|
||||
| |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ Which flash command to use for flashing the MCU? ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ 1) make flash (default) ║
|
||||
║ 2) make serialflash (stm32flash) ║
|
||||
╟───────────────────────────┬───────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
@@ -185,15 +184,15 @@ class KlipperSelectMcuConnectionMenu(BaseMenu):
|
||||
count = 62 - len(color) - len(RESET_FORMAT)
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| |
|
||||
| How is the controller board connected to the host? |
|
||||
| 1) USB |
|
||||
| 2) UART |
|
||||
| 3) USB (DFU mode) |
|
||||
| |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ How is the controller board connected to the host? ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ 1) USB ║
|
||||
║ 2) UART ║
|
||||
║ 3) USB (DFU mode) ║
|
||||
╟───────────────────────────┬───────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
@@ -271,20 +270,20 @@ class KlipperSelectMcuIdMenu(BaseMenu):
|
||||
count = 62 - len(color) - len(RESET_FORMAT)
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| Make sure, to select the correct MCU! |
|
||||
| ONLY flash a firmware created for the respective MCU! |
|
||||
| |
|
||||
|{header2:-^64}|
|
||||
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ Make sure, to select the correct MCU! ║
|
||||
║ ONLY flash a firmware created for the respective MCU! ║
|
||||
║ ║
|
||||
╟{header2:─^64}╢
|
||||
"""
|
||||
)[1:]
|
||||
|
||||
for i, mcu in enumerate(self.mcu_list):
|
||||
mcu = mcu.split("/")[-1]
|
||||
menu += f" ● MCU #{i}: {COLOR_CYAN}{mcu}{RESET_FORMAT}\n"
|
||||
menu += "╟───────────────────────────┬───────────────────────────╢"
|
||||
|
||||
print(menu, end="\n")
|
||||
|
||||
@@ -325,12 +324,12 @@ class KlipperSelectSDFlashBoardMenu(BaseMenu):
|
||||
else:
|
||||
menu = textwrap.dedent(
|
||||
"""
|
||||
/=======================================================\\
|
||||
| Please select the type of board that corresponds to |
|
||||
| the currently selected MCU ID you chose before. |
|
||||
| |
|
||||
| The following boards are currently supported: |
|
||||
|-------------------------------------------------------|
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ Please select the type of board that corresponds to ║
|
||||
║ the currently selected MCU ID you chose before. ║
|
||||
║ ║
|
||||
║ The following boards are currently supported: ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
|
||||
@@ -346,17 +345,16 @@ class KlipperSelectSDFlashBoardMenu(BaseMenu):
|
||||
self.baudrate_select()
|
||||
|
||||
def baudrate_select(self, **kwargs):
|
||||
menu = textwrap.dedent(
|
||||
"""
|
||||
/=======================================================\\
|
||||
| If your board is flashed with firmware that connects |
|
||||
| at a custom baud rate, please change it now. |
|
||||
| |
|
||||
| If you are unsure, stick to the default 250000! |
|
||||
\\=======================================================/
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
Logger.print_dialog(
|
||||
DialogType.CUSTOM,
|
||||
[
|
||||
"If your board is flashed with firmware that connects "
|
||||
"at a custom baud rate, please change it now.",
|
||||
"\n\n",
|
||||
"If you are unsure, stick to the default 250000!",
|
||||
],
|
||||
end="",
|
||||
)
|
||||
self.flash_options.selected_baudrate = get_number_input(
|
||||
question="Please set the baud rate",
|
||||
default=250000,
|
||||
@@ -399,16 +397,15 @@ class KlipperFlashOverviewMenu(BaseMenu):
|
||||
subheader = f"[{COLOR_CYAN}Overview{RESET_FORMAT}]"
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| Before contuining the flashing process, please check |
|
||||
| if all parameters were set correctly! Once you made |
|
||||
| sure everything is correct, start the process. If any |
|
||||
| parameter needs to be changed, you can go back (B) |
|
||||
| step by step or abort and start from the beginning. |
|
||||
|{subheader:-^64}|
|
||||
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ Before contuining the flashing process, please check ║
|
||||
║ if all parameters were set correctly! Once you made ║
|
||||
║ sure everything is correct, start the process. If any ║
|
||||
║ parameter needs to be changed, you can go back (B) ║
|
||||
║ step by step or abort and start from the beginning. ║
|
||||
║{subheader:-^64}║
|
||||
"""
|
||||
)[1:]
|
||||
|
||||
@@ -423,9 +420,9 @@ class KlipperFlashOverviewMenu(BaseMenu):
|
||||
|
||||
menu += textwrap.dedent(
|
||||
"""
|
||||
|-------------------------------------------------------|
|
||||
| Y) Start flash process |
|
||||
| N) Abort - Return to Advanced Menu |
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ Y) Start flash process ║
|
||||
║ N) Abort - Return to Advanced Menu ║
|
||||
"""
|
||||
)
|
||||
print(menu, end="")
|
||||
|
||||
@@ -42,17 +42,18 @@ class LogUploadMenu(BaseMenu):
|
||||
count = 62 - len(color) - len(RESET_FORMAT)
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| You can select the following logfiles for uploading: |
|
||||
| |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ You can select the following logfiles for uploading: ║
|
||||
║ ║
|
||||
"""
|
||||
)[1:]
|
||||
|
||||
for logfile in enumerate(self.logfile_list):
|
||||
line = f"{logfile[0]}) {logfile[1].get('display_name')}"
|
||||
menu += f"| {line:<54}|\n"
|
||||
menu += f"║ {line:<54}║\n"
|
||||
menu += "╟───────────────────────────────────────────────────────╢\n"
|
||||
|
||||
print(menu, end="")
|
||||
|
||||
|
||||
@@ -58,21 +58,22 @@ class MoonrakerRemoveMenu(BaseMenu):
|
||||
o5 = checked if self.delete_moonraker_logs else unchecked
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| Enter a number and hit enter to select / deselect |
|
||||
| the specific option for removal. |
|
||||
|-------------------------------------------------------|
|
||||
| 0) Select everything |
|
||||
|-------------------------------------------------------|
|
||||
| 1) {o1} Remove Service |
|
||||
| 2) {o2} Remove Local Repository |
|
||||
| 3) {o3} Remove Python Environment |
|
||||
| 4) {o4} Remove Policy Kit Rules |
|
||||
| 5) {o5} Delete all Log-Files |
|
||||
|-------------------------------------------------------|
|
||||
| C) Continue |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ Enter a number and hit enter to select / deselect ║
|
||||
║ the specific option for removal. ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ 0) Select everything ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ 1) {o1} Remove Service ║
|
||||
║ 2) {o2} Remove Local Repository ║
|
||||
║ 3) {o3} Remove Python Environment ║
|
||||
║ 4) {o4} Remove Policy Kit Rules ║
|
||||
║ 5) {o5} Delete all Log-Files ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ C) Continue ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
|
||||
@@ -60,16 +60,16 @@ class ClientRemoveMenu(BaseMenu):
|
||||
o2 = checked if self.rm_client_config else unchecked
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| Enter a number and hit enter to select / deselect |
|
||||
| the specific option for removal. |
|
||||
|-------------------------------------------------------|
|
||||
| 0) Select everything |
|
||||
|-------------------------------------------------------|
|
||||
| 1) {o1} Remove {client_name:16} |
|
||||
| 2) {o2} Remove {client_config_name:24} |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ Enter a number and hit enter to select / deselect ║
|
||||
║ the specific option for removal. ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ 0) Select everything ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ 1) {o1} Remove {client_name:16} ║
|
||||
║ 2) {o2} Remove {client_config_name:24} ║
|
||||
"""
|
||||
)[1:]
|
||||
|
||||
@@ -77,14 +77,15 @@ class ClientRemoveMenu(BaseMenu):
|
||||
o3 = checked if self.backup_mainsail_config_json else unchecked
|
||||
menu += textwrap.dedent(
|
||||
f"""
|
||||
| 3) {o3} Backup config.json |
|
||||
║ 3) {o3} Backup config.json ║
|
||||
"""
|
||||
)[1:]
|
||||
|
||||
menu += textwrap.dedent(
|
||||
"""
|
||||
|-------------------------------------------------------|
|
||||
| C) Continue |
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ C) Continue ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
|
||||
@@ -43,12 +43,12 @@ class AdvancedMenu(BaseMenu):
|
||||
|
||||
def set_options(self):
|
||||
self.options = {
|
||||
"1": Option(method=self.klipper_rollback, menu=True),
|
||||
"2": Option(method=self.moonraker_rollback, menu=True),
|
||||
"3": Option(method=self.build, menu=True),
|
||||
"4": Option(method=self.flash, menu=False),
|
||||
"5": Option(method=self.build_flash, menu=False),
|
||||
"6": Option(method=self.get_id, menu=False),
|
||||
"1": Option(method=self.build, menu=True),
|
||||
"2": Option(method=self.flash, menu=False),
|
||||
"3": Option(method=self.build_flash, menu=False),
|
||||
"4": Option(method=self.get_id, menu=False),
|
||||
"5": Option(method=self.klipper_rollback, menu=True),
|
||||
"6": Option(method=self.moonraker_rollback, menu=True),
|
||||
}
|
||||
|
||||
def print_menu(self):
|
||||
@@ -57,18 +57,15 @@ class AdvancedMenu(BaseMenu):
|
||||
count = 62 - len(color) - len(RESET_FORMAT)
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| Repo Rollback: |
|
||||
| 1) [Klipper] |
|
||||
| 2) [Moonraker] |
|
||||
| |
|
||||
| Klipper Firmware: |
|
||||
| 3) [Build] |
|
||||
| 4) [Flash] |
|
||||
| 5) [Build + Flash] |
|
||||
| 6) [Get MCU ID] |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────┬───────────────────────────╢
|
||||
║ Klipper Firmware: │ Repository Rollback: ║
|
||||
║ 1) [Build] │ 5) [Klipper] ║
|
||||
║ 2) [Flash] │ 6) [Moonraker] ║
|
||||
║ 3) [Build + Flash] │ ║
|
||||
║ 4) [Get MCU ID] │ ║
|
||||
╟───────────────────────────┴───────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
|
||||
@@ -62,20 +62,21 @@ class BackupMenu(BaseMenu):
|
||||
count = 62 - len(color) - len(RESET_FORMAT)
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| {line1:^62} |
|
||||
|-------------------------------------------------------|
|
||||
| Klipper & Moonraker API: | Client-Config: |
|
||||
| 1) [Klipper] | 7) [Mainsail-Config] |
|
||||
| 2) [Moonraker] | 8) [Fluidd-Config] |
|
||||
| 3) [Config Folder] | |
|
||||
| 4) [Moonraker Database] | Touchscreen GUI: |
|
||||
| | 9) [KlipperScreen] |
|
||||
| Webinterface: | |
|
||||
| 5) [Mainsail] | |
|
||||
| 6) [Fluidd] | |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ {line1:^62} ║
|
||||
╟───────────────────────────┬───────────────────────────╢
|
||||
║ Klipper & Moonraker API: │ Client-Config: ║
|
||||
║ 1) [Klipper] │ 7) [Mainsail-Config] ║
|
||||
║ 2) [Moonraker] │ 8) [Fluidd-Config] ║
|
||||
║ 3) [Config Folder] │ ║
|
||||
║ 4) [Moonraker Database] │ Touchscreen GUI: ║
|
||||
║ │ 9) [KlipperScreen] ║
|
||||
║ Webinterface: │ ║
|
||||
║ 5) [Mainsail] │ ║
|
||||
║ 6) [Fluidd] │ ║
|
||||
╟───────────────────────────┴───────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
|
||||
@@ -39,11 +39,11 @@ def print_header():
|
||||
count = 62 - len(color) - len(RESET_FORMAT)
|
||||
header = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{line1:~^{count}}{RESET_FORMAT} |
|
||||
| {color}{line2:^{count}}{RESET_FORMAT} |
|
||||
| {color}{line3:~^{count}}{RESET_FORMAT} |
|
||||
\=======================================================/
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{line1:~^{count}}{RESET_FORMAT} ║
|
||||
║ {color}{line2:^{count}}{RESET_FORMAT} ║
|
||||
║ {color}{line3:~^{count}}{RESET_FORMAT} ║
|
||||
╚═══════════════════════════════════════════════════════╝
|
||||
"""
|
||||
)[1:]
|
||||
print(header, end="")
|
||||
@@ -55,9 +55,8 @@ def print_quit_footer():
|
||||
count = 62 - len(color) - len(RESET_FORMAT)
|
||||
footer = textwrap.dedent(
|
||||
f"""
|
||||
|-------------------------------------------------------|
|
||||
| {color}{text:^{count}}{RESET_FORMAT} |
|
||||
\=======================================================/
|
||||
║ {color}{text:^{count}}{RESET_FORMAT} ║
|
||||
╚═══════════════════════════════════════════════════════╝
|
||||
"""
|
||||
)[1:]
|
||||
print(footer, end="")
|
||||
@@ -69,9 +68,8 @@ def print_back_footer():
|
||||
count = 62 - len(color) - len(RESET_FORMAT)
|
||||
footer = textwrap.dedent(
|
||||
f"""
|
||||
|-------------------------------------------------------|
|
||||
| {color}{text:^{count}}{RESET_FORMAT} |
|
||||
\=======================================================/
|
||||
║ {color}{text:^{count}}{RESET_FORMAT} ║
|
||||
╚═══════════════════════════════════════════════════════╝
|
||||
"""
|
||||
)[1:]
|
||||
print(footer, end="")
|
||||
@@ -85,16 +83,15 @@ def print_back_help_footer():
|
||||
count = 34 - len(color1) - len(RESET_FORMAT)
|
||||
footer = textwrap.dedent(
|
||||
f"""
|
||||
|-------------------------------------------------------|
|
||||
| {color1}{text1:^{count}}{RESET_FORMAT} | {color2}{text2:^{count}}{RESET_FORMAT} |
|
||||
\=======================================================/
|
||||
║ {color1}{text1:^{count}}{RESET_FORMAT} │ {color2}{text2:^{count}}{RESET_FORMAT} ║
|
||||
╚═══════════════════════════╧═══════════════════════════╝
|
||||
"""
|
||||
)[1:]
|
||||
print(footer, end="")
|
||||
|
||||
|
||||
def print_blank_footer():
|
||||
print("\=======================================================/")
|
||||
print("╚═══════════════════════════════════════════════════════╝")
|
||||
|
||||
|
||||
class PostInitCaller(type):
|
||||
@@ -168,7 +165,7 @@ class BaseMenu(metaclass=PostInitCaller):
|
||||
elif self.footer_type is FooterType.BLANK:
|
||||
print_blank_footer()
|
||||
else:
|
||||
raise NotImplementedError
|
||||
raise NotImplementedError("FooterType not correctly implemented!")
|
||||
|
||||
def display_menu(self) -> None:
|
||||
if self.header:
|
||||
|
||||
@@ -57,21 +57,22 @@ class InstallMenu(BaseMenu):
|
||||
count = 62 - len(color) - len(RESET_FORMAT)
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| Firmware & API: | Touchscreen GUI: |
|
||||
| 1) [Klipper] | 7) [KlipperScreen] |
|
||||
| 2) [Moonraker] | |
|
||||
| | Android / iOS: |
|
||||
| Webinterface: | 8) [Mobileraker] |
|
||||
| 3) [Mainsail] | |
|
||||
| 4) [Fluidd] | Webcam Streamer: |
|
||||
| | 9) [Crowsnest] |
|
||||
| Client-Config: | |
|
||||
| 5) [Mainsail-Config] | |
|
||||
| 6) [Fluidd-Config] | |
|
||||
| | |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────┬───────────────────────────╢
|
||||
║ Firmware & API: │ Touchscreen GUI: ║
|
||||
║ 1) [Klipper] │ 7) [KlipperScreen] ║
|
||||
║ 2) [Moonraker] │ ║
|
||||
║ │ Android / iOS: ║
|
||||
║ Webinterface: │ 8) [Mobileraker] ║
|
||||
║ 3) [Mainsail] │ ║
|
||||
║ 4) [Fluidd] │ Webcam Streamer: ║
|
||||
║ │ 9) [Crowsnest] ║
|
||||
║ Client-Config: │ ║
|
||||
║ 5) [Mainsail-Config] │ ║
|
||||
║ 6) [Fluidd-Config] │ ║
|
||||
║ │ ║
|
||||
╟───────────────────────────┴───────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# #
|
||||
# This file may be distributed under the terms of the GNU GPLv3 license #
|
||||
# ======================================================================= #
|
||||
|
||||
import sys
|
||||
import textwrap
|
||||
from typing import Optional, Type
|
||||
|
||||
@@ -39,6 +39,7 @@ from utils.constants import (
|
||||
COLOR_YELLOW,
|
||||
RESET_FORMAT,
|
||||
)
|
||||
from utils.logger import Logger
|
||||
from utils.types import ComponentStatus
|
||||
|
||||
|
||||
@@ -117,7 +118,7 @@ class MainMenu(BaseMenu):
|
||||
self.fetch_status()
|
||||
|
||||
header = " [ Main Menu ] "
|
||||
footer1 = "KIAUH v6.0.0"
|
||||
footer1 = f"{COLOR_CYAN}KIAUH v6.0.0{RESET_FORMAT}"
|
||||
footer2 = f"Changelog: {COLOR_MAGENTA}https://git.io/JnmlX{RESET_FORMAT}"
|
||||
color = COLOR_CYAN
|
||||
count = 62 - len(color) - len(RESET_FORMAT)
|
||||
@@ -125,28 +126,33 @@ class MainMenu(BaseMenu):
|
||||
pad2 = 26
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| 0) [Log-Upload] | Klipper: {self.kl_status:<{pad1}} |
|
||||
| | Repo: {self.kl_repo:<{pad1}} |
|
||||
| 1) [Install] |------------------------------------|
|
||||
| 2) [Update] | Moonraker: {self.mr_status:<{pad1}} |
|
||||
| 3) [Remove] | Repo: {self.mr_repo:<{pad1}} |
|
||||
| 4) [Advanced] |------------------------------------|
|
||||
| 5) [Backup] | Mainsail: {self.ms_status:<{pad2}} |
|
||||
| | Fluidd: {self.fl_status:<{pad2}} |
|
||||
| S) [Settings] | Client-Config: {self.cc_status:<{pad2}} |
|
||||
| | |
|
||||
| Community: | KlipperScreen: {self.ks_status:<{pad2}} |
|
||||
| E) [Extensions] | Mobileraker: {self.mb_status:<{pad2}} |
|
||||
| | Crowsnest: {self.cn_status:<{pad2}} |
|
||||
|-------------------------------------------------------|
|
||||
| {COLOR_CYAN}{footer1:^16}{RESET_FORMAT} | {footer2:^43} |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟──────────────────┬────────────────────────────────────╢
|
||||
║ 0) [Log-Upload] │ Klipper: {self.kl_status:<{pad1}} ║
|
||||
║ │ Repo: {self.kl_repo:<{pad1}} ║
|
||||
║ 1) [Install] ├────────────────────────────────────╢
|
||||
║ 2) [Update] │ Moonraker: {self.mr_status:<{pad1}} ║
|
||||
║ 3) [Remove] │ Repo: {self.mr_repo:<{pad1}} ║
|
||||
║ 4) [Advanced] ├────────────────────────────────────╢
|
||||
║ 5) [Backup] │ Mainsail: {self.ms_status:<{pad2}} ║
|
||||
║ │ Fluidd: {self.fl_status:<{pad2}} ║
|
||||
║ S) [Settings] │ Client-Config: {self.cc_status:<{pad2}} ║
|
||||
║ │ ║
|
||||
║ Community: │ KlipperScreen: {self.ks_status:<{pad2}} ║
|
||||
║ E) [Extensions] │ Mobileraker: {self.mb_status:<{pad2}} ║
|
||||
║ │ Crowsnest: {self.cn_status:<{pad2}} ║
|
||||
╟──────────────────┼────────────────────────────────────╢
|
||||
║ {footer1:^25} │ {footer2:^43} ║
|
||||
╟──────────────────┴────────────────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
|
||||
def exit(self, **kwargs):
|
||||
Logger.print_ok("###### Happy printing!", False)
|
||||
sys.exit(0)
|
||||
|
||||
def log_upload_menu(self, **kwargs):
|
||||
LogUploadMenu().run()
|
||||
|
||||
|
||||
@@ -56,19 +56,20 @@ class RemoveMenu(BaseMenu):
|
||||
count = 62 - len(color) - len(RESET_FORMAT)
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| INFO: Configurations and/or any backups will be kept! |
|
||||
|-------------------------------------------------------|
|
||||
| Firmware & API: | Touchscreen GUI: |
|
||||
| 1) [Klipper] | 5) [KlipperScreen] |
|
||||
| 2) [Moonraker] | |
|
||||
| | Android / iOS: |
|
||||
| Klipper Webinterface: | 6) [Mobileraker] |
|
||||
| 3) [Mainsail] | |
|
||||
| 4) [Fluidd] | Webcam Streamer: |
|
||||
| | 7) [Crowsnest] |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ INFO: Configurations and/or any backups will be kept! ║
|
||||
╟───────────────────────────┬───────────────────────────╢
|
||||
║ Firmware & API: │ Touchscreen GUI: ║
|
||||
║ 1) [Klipper] │ 5) [KlipperScreen] ║
|
||||
║ 2) [Moonraker] │ ║
|
||||
║ │ Android / iOS: ║
|
||||
║ Klipper Webinterface: │ 6) [Mobileraker] ║
|
||||
║ 3) [Mainsail] │ ║
|
||||
║ 4) [Fluidd] │ Webcam Streamer: ║
|
||||
║ │ 7) [Crowsnest] ║
|
||||
╟───────────────────────────┴───────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
|
||||
@@ -65,30 +65,31 @@ class SettingsMenu(BaseMenu):
|
||||
o3 = checked if self.auto_backups_enabled else unchecked
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| Klipper source repository: |
|
||||
| ● {self.klipper_repo:<67} |
|
||||
| |
|
||||
| Moonraker source repository: |
|
||||
| ● {self.moonraker_repo:<67} |
|
||||
| |
|
||||
| Install unstable Webinterface releases: |
|
||||
| {o1} Mainsail |
|
||||
| {o2} Fluidd |
|
||||
| |
|
||||
| Auto-Backup: |
|
||||
| {o3} Automatic backup before update |
|
||||
| |
|
||||
|-------------------------------------------------------|
|
||||
| 1) Set Klipper source repository |
|
||||
| 2) Set Moonraker source repository |
|
||||
| |
|
||||
| 3) Toggle unstable Mainsail releases |
|
||||
| 4) Toggle unstable Fluidd releases |
|
||||
| |
|
||||
| 5) Toggle automatic backups before updates |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ Klipper source repository: ║
|
||||
║ ● {self.klipper_repo:<67} ║
|
||||
║ ║
|
||||
║ Moonraker source repository: ║
|
||||
║ ● {self.moonraker_repo:<67} ║
|
||||
║ ║
|
||||
║ Install unstable Webinterface releases: ║
|
||||
║ {o1} Mainsail ║
|
||||
║ {o2} Fluidd ║
|
||||
║ ║
|
||||
║ Auto-Backup: ║
|
||||
║ {o3} Automatic backup before update ║
|
||||
║ ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ 1) Set Klipper source repository ║
|
||||
║ 2) Set Moonraker source repository ║
|
||||
║ ║
|
||||
║ 3) Toggle unstable Mainsail releases ║
|
||||
║ 4) Toggle unstable Fluidd releases ║
|
||||
║ ║
|
||||
║ 5) Toggle automatic backups before updates ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
|
||||
@@ -93,29 +93,30 @@ class UpdateMenu(BaseMenu):
|
||||
count = 62 - len(color) - len(RESET_FORMAT)
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| 0) Update all | | |
|
||||
| | Current: | Latest: |
|
||||
| Klipper & API: |---------------|---------------|
|
||||
| 1) Klipper | {self.kl_local:<22} | {self.kl_remote:<22} |
|
||||
| 2) Moonraker | {self.mr_local:<22} | {self.mr_remote:<22} |
|
||||
| | | |
|
||||
| Webinterface: |---------------|---------------|
|
||||
| 3) Mainsail | {self.ms_local:<22} | {self.ms_remote:<22} |
|
||||
| 4) Fluidd | {self.fl_local:<22} | {self.fl_remote:<22} |
|
||||
| | | |
|
||||
| Client-Config: |---------------|---------------|
|
||||
| 5) Mainsail-Config | {self.mc_local:<22} | {self.mc_remote:<22} |
|
||||
| 6) Fluidd-Config | {self.fc_local:<22} | {self.fc_remote:<22} |
|
||||
| | | |
|
||||
| Other: |---------------|---------------|
|
||||
| 7) KlipperScreen | {self.ks_local:<22} | {self.ks_remote:<22} |
|
||||
| 8) Mobileraker | {self.mb_local:<22} | {self.mb_remote:<22} |
|
||||
| 9) Crowsnest | {self.cn_local:<22} | {self.cn_remote:<22} |
|
||||
| |-------------------------------|
|
||||
| 10) System | |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────┬───────────────┬───────────────╢
|
||||
║ 0) Update all │ │ ║
|
||||
║ │ Current: │ Latest: ║
|
||||
║ Klipper & API: ├───────────────┼───────────────╢
|
||||
║ 1) Klipper │ {self.kl_local:<22} │ {self.kl_remote:<22} ║
|
||||
║ 2) Moonraker │ {self.mr_local:<22} │ {self.mr_remote:<22} ║
|
||||
║ │ │ ║
|
||||
║ Webinterface: ├───────────────┼───────────────╢
|
||||
║ 3) Mainsail │ {self.ms_local:<22} │ {self.ms_remote:<22} ║
|
||||
║ 4) Fluidd │ {self.fl_local:<22} │ {self.fl_remote:<22} ║
|
||||
║ │ │ ║
|
||||
║ Client-Config: ├───────────────┼───────────────╢
|
||||
║ 5) Mainsail-Config │ {self.mc_local:<22} │ {self.mc_remote:<22} ║
|
||||
║ 6) Fluidd-Config │ {self.fc_local:<22} │ {self.fc_remote:<22} ║
|
||||
║ │ │ ║
|
||||
║ Other: ├───────────────┼───────────────╢
|
||||
║ 7) KlipperScreen │ {self.ks_local:<22} │ {self.ks_remote:<22} ║
|
||||
║ 8) Mobileraker │ {self.mb_local:<22} │ {self.mb_remote:<22} ║
|
||||
║ 9) Crowsnest │ {self.cn_local:<22} │ {self.cn_remote:<22} ║
|
||||
║ ├───────────────┴───────────────╢
|
||||
║ 10) System │ ║
|
||||
╟───────────────────────┴───────────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
|
||||
@@ -87,11 +87,11 @@ class ExtensionsMenu(BaseMenu):
|
||||
count = 62 - len(color) - len(RESET_FORMAT)
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
| {line1:<62} |
|
||||
| |
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ {line1:<62} ║
|
||||
║ ║
|
||||
"""
|
||||
)[1:]
|
||||
print(menu, end="")
|
||||
@@ -100,7 +100,8 @@ class ExtensionsMenu(BaseMenu):
|
||||
index = extension.metadata.get("index")
|
||||
name = extension.metadata.get("display_name")
|
||||
row = f"{index}) {name}"
|
||||
print(f"| {row:<53} |")
|
||||
print(f"║ {row:<53} ║")
|
||||
print("╟───────────────────────────────────────────────────────╢")
|
||||
|
||||
|
||||
# noinspection PyUnusedLocal
|
||||
@@ -135,29 +136,30 @@ class ExtensionSubmenu(BaseMenu):
|
||||
description_text = Logger.format_content(
|
||||
description,
|
||||
line_width,
|
||||
border_left="|",
|
||||
border_right="|",
|
||||
border_left="║",
|
||||
border_right="║",
|
||||
)
|
||||
|
||||
menu = textwrap.dedent(
|
||||
f"""
|
||||
/=======================================================\\
|
||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||
|-------------------------------------------------------|
|
||||
╔═══════════════════════════════════════════════════════╗
|
||||
║ {color}{header:~^{count}}{RESET_FORMAT} ║
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
"""
|
||||
)[1:]
|
||||
menu += f"{description_text}\n"
|
||||
menu += textwrap.dedent(
|
||||
"""
|
||||
|-------------------------------------------------------|
|
||||
| 1) Install |
|
||||
╟───────────────────────────────────────────────────────╢
|
||||
║ 1) Install ║
|
||||
"""
|
||||
)[1:]
|
||||
|
||||
if self.extension.metadata.get("updates"):
|
||||
menu += "| 2) Update |\n"
|
||||
menu += "| 3) Remove |\n"
|
||||
menu += "║ 2) Update ║\n"
|
||||
menu += "║ 3) Remove ║\n"
|
||||
else:
|
||||
menu += "| 2) Remove |\n"
|
||||
menu += "║ 2) Remove ║\n"
|
||||
menu += "╟───────────────────────────────────────────────────────╢\n"
|
||||
|
||||
print(menu, end="")
|
||||
|
||||
Reference in New Issue
Block a user