mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-26 01:03:35 +05:00
chore: ruff organize imports
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -13,7 +13,7 @@ from typing import List
|
|||||||
|
|
||||||
from core.instance_manager.base_instance import BaseInstance
|
from core.instance_manager.base_instance import BaseInstance
|
||||||
from core.menus.base_menu import print_back_footer
|
from core.menus.base_menu import print_back_footer
|
||||||
from utils.constants import COLOR_GREEN, RESET_FORMAT, COLOR_YELLOW, COLOR_CYAN
|
from utils.constants import COLOR_CYAN, COLOR_GREEN, COLOR_YELLOW, RESET_FORMAT
|
||||||
|
|
||||||
|
|
||||||
@unique
|
@unique
|
||||||
|
|||||||
@@ -9,10 +9,6 @@
|
|||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from components.webui_client.client_utils import (
|
|
||||||
get_existing_clients,
|
|
||||||
)
|
|
||||||
from core.settings.kiauh_settings import KiauhSettings
|
|
||||||
from components.klipper import (
|
from components.klipper import (
|
||||||
EXIT_KLIPPER_SETUP,
|
EXIT_KLIPPER_SETUP,
|
||||||
KLIPPER_DIR,
|
KLIPPER_DIR,
|
||||||
@@ -22,28 +18,32 @@ from components.klipper import (
|
|||||||
from components.klipper.klipper import Klipper
|
from components.klipper.klipper import Klipper
|
||||||
from components.klipper.klipper_dialogs import print_update_warn_dialog
|
from components.klipper.klipper_dialogs import print_update_warn_dialog
|
||||||
from components.klipper.klipper_utils import (
|
from components.klipper.klipper_utils import (
|
||||||
handle_disruptive_system_packages,
|
|
||||||
check_user_groups,
|
|
||||||
handle_to_multi_instance_conversion,
|
|
||||||
create_example_printer_cfg,
|
|
||||||
add_to_existing,
|
add_to_existing,
|
||||||
get_install_count,
|
|
||||||
init_name_scheme,
|
|
||||||
check_is_single_to_multi_conversion,
|
|
||||||
update_name_scheme,
|
|
||||||
handle_instance_naming,
|
|
||||||
backup_klipper_dir,
|
backup_klipper_dir,
|
||||||
|
check_is_single_to_multi_conversion,
|
||||||
|
check_user_groups,
|
||||||
|
create_example_printer_cfg,
|
||||||
|
get_install_count,
|
||||||
|
handle_disruptive_system_packages,
|
||||||
|
handle_instance_naming,
|
||||||
|
handle_to_multi_instance_conversion,
|
||||||
|
init_name_scheme,
|
||||||
|
update_name_scheme,
|
||||||
)
|
)
|
||||||
from components.moonraker.moonraker import Moonraker
|
from components.moonraker.moonraker import Moonraker
|
||||||
|
from components.webui_client.client_utils import (
|
||||||
|
get_existing_clients,
|
||||||
|
)
|
||||||
from core.instance_manager.instance_manager import InstanceManager
|
from core.instance_manager.instance_manager import InstanceManager
|
||||||
|
from core.settings.kiauh_settings import KiauhSettings
|
||||||
from utils.common import check_install_dependencies
|
from utils.common import check_install_dependencies
|
||||||
from utils.git_utils import git_clone_wrapper, git_pull_wrapper
|
from utils.git_utils import git_clone_wrapper, git_pull_wrapper
|
||||||
from utils.input_utils import get_confirm
|
from utils.input_utils import get_confirm
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
from utils.sys_utils import (
|
from utils.sys_utils import (
|
||||||
parse_packages_from_file,
|
|
||||||
create_python_venv,
|
create_python_venv,
|
||||||
install_python_requirements,
|
install_python_requirements,
|
||||||
|
parse_packages_from_file,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
from typing import Type, Optional
|
from typing import Optional, Type
|
||||||
|
|
||||||
from components.klipper import klipper_remove
|
from components.klipper import klipper_remove
|
||||||
from core.menus import FooterType, Option
|
from core.menus import FooterType, Option
|
||||||
from core.menus.base_menu import BaseMenu
|
from core.menus.base_menu import BaseMenu
|
||||||
from utils.constants import RESET_FORMAT, COLOR_RED, COLOR_CYAN
|
from utils.constants import COLOR_CYAN, COLOR_RED, RESET_FORMAT
|
||||||
|
|
||||||
|
|
||||||
# noinspection PyUnusedLocal
|
# noinspection PyUnusedLocal
|
||||||
|
|||||||
@@ -7,15 +7,15 @@
|
|||||||
# This file may be distributed under the terms of the GNU GPLv3 license #
|
# This file may be distributed under the terms of the GNU GPLv3 license #
|
||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
|
|
||||||
from subprocess import CalledProcessError, check_output, Popen, PIPE, STDOUT, run
|
from subprocess import PIPE, STDOUT, CalledProcessError, Popen, check_output, run
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from components.klipper import KLIPPER_DIR
|
from components.klipper import KLIPPER_DIR
|
||||||
from components.klipper.klipper import Klipper
|
from components.klipper.klipper import Klipper
|
||||||
from components.klipper_firmware import SD_FLASH_SCRIPT
|
from components.klipper_firmware import SD_FLASH_SCRIPT
|
||||||
from components.klipper_firmware.flash_options import (
|
from components.klipper_firmware.flash_options import (
|
||||||
FlashOptions,
|
|
||||||
FlashMethod,
|
FlashMethod,
|
||||||
|
FlashOptions,
|
||||||
)
|
)
|
||||||
from core.instance_manager.instance_manager import InstanceManager
|
from core.instance_manager.instance_manager import InstanceManager
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
from dataclasses import field
|
from dataclasses import field
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Union, List
|
from typing import List, Union
|
||||||
|
|
||||||
|
|
||||||
class FlashMethod(Enum):
|
class FlashMethod(Enum):
|
||||||
|
|||||||
@@ -8,22 +8,22 @@
|
|||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
from typing import Type, Optional
|
from typing import Optional, Type
|
||||||
|
|
||||||
from components.klipper import KLIPPER_DIR
|
from components.klipper import KLIPPER_DIR
|
||||||
from components.klipper_firmware.firmware_utils import (
|
from components.klipper_firmware.firmware_utils import (
|
||||||
|
run_make,
|
||||||
run_make_clean,
|
run_make_clean,
|
||||||
run_make_menuconfig,
|
run_make_menuconfig,
|
||||||
run_make,
|
|
||||||
)
|
)
|
||||||
from core.menus import Option
|
from core.menus import Option
|
||||||
from core.menus.base_menu import BaseMenu
|
from core.menus.base_menu import BaseMenu
|
||||||
from utils.constants import COLOR_CYAN, RESET_FORMAT, COLOR_GREEN, COLOR_RED
|
from utils.constants import COLOR_CYAN, COLOR_GREEN, COLOR_RED, RESET_FORMAT
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
from utils.sys_utils import (
|
from utils.sys_utils import (
|
||||||
check_package_install,
|
check_package_install,
|
||||||
update_system_package_lists,
|
|
||||||
install_system_packages,
|
install_system_packages,
|
||||||
|
update_system_package_lists,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
import textwrap
|
import textwrap
|
||||||
from typing import Optional, Type
|
from typing import Optional, Type
|
||||||
|
|
||||||
from components.klipper_firmware.flash_options import FlashOptions, FlashMethod
|
from components.klipper_firmware.flash_options import FlashMethod, FlashOptions
|
||||||
from core.menus import FooterType, Option
|
from core.menus import FooterType, Option
|
||||||
from core.menus.base_menu import BaseMenu
|
from core.menus.base_menu import BaseMenu
|
||||||
from utils.constants import COLOR_RED, RESET_FORMAT
|
from utils.constants import COLOR_RED, RESET_FORMAT
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
# This file may be distributed under the terms of the GNU GPLv3 license #
|
# This file may be distributed under the terms of the GNU GPLv3 license #
|
||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
import textwrap
|
import textwrap
|
||||||
from typing import Type, Optional
|
from typing import Optional, Type
|
||||||
|
|
||||||
from core.menus.base_menu import BaseMenu
|
from core.menus.base_menu import BaseMenu
|
||||||
from utils.constants import COLOR_CYAN, RESET_FORMAT, COLOR_YELLOW
|
from utils.constants import COLOR_CYAN, COLOR_YELLOW, RESET_FORMAT
|
||||||
|
|
||||||
|
|
||||||
# noinspection DuplicatedCode
|
# noinspection DuplicatedCode
|
||||||
|
|||||||
@@ -9,35 +9,34 @@
|
|||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
import time
|
import time
|
||||||
from typing import Type, Optional
|
from typing import Optional, Type
|
||||||
|
|
||||||
from components.klipper_firmware.flash_options import (
|
|
||||||
FlashOptions,
|
|
||||||
FlashMethod,
|
|
||||||
FlashCommand,
|
|
||||||
ConnectionType,
|
|
||||||
)
|
|
||||||
from components.klipper_firmware.firmware_utils import (
|
from components.klipper_firmware.firmware_utils import (
|
||||||
find_usb_device_by_id,
|
find_firmware_file,
|
||||||
find_uart_device,
|
find_uart_device,
|
||||||
|
find_usb_device_by_id,
|
||||||
find_usb_dfu_device,
|
find_usb_dfu_device,
|
||||||
get_sd_flash_board_list,
|
get_sd_flash_board_list,
|
||||||
start_flash_process,
|
start_flash_process,
|
||||||
find_firmware_file,
|
)
|
||||||
|
from components.klipper_firmware.flash_options import (
|
||||||
|
ConnectionType,
|
||||||
|
FlashCommand,
|
||||||
|
FlashMethod,
|
||||||
|
FlashOptions,
|
||||||
)
|
)
|
||||||
from components.klipper_firmware.menus.klipper_flash_error_menu import (
|
from components.klipper_firmware.menus.klipper_flash_error_menu import (
|
||||||
KlipperNoBoardTypesErrorMenu,
|
KlipperNoBoardTypesErrorMenu,
|
||||||
KlipperNoFirmwareErrorMenu,
|
KlipperNoFirmwareErrorMenu,
|
||||||
)
|
)
|
||||||
from components.klipper_firmware.menus.klipper_flash_help_menu import (
|
from components.klipper_firmware.menus.klipper_flash_help_menu import (
|
||||||
KlipperMcuConnectionHelpMenu,
|
|
||||||
KlipperFlashCommandHelpMenu,
|
KlipperFlashCommandHelpMenu,
|
||||||
KlipperFlashMethodHelpMenu,
|
KlipperFlashMethodHelpMenu,
|
||||||
|
KlipperMcuConnectionHelpMenu,
|
||||||
)
|
)
|
||||||
from core.menus import FooterType, Option
|
from core.menus import FooterType, Option
|
||||||
|
|
||||||
from core.menus.base_menu import BaseMenu
|
from core.menus.base_menu import BaseMenu
|
||||||
from utils.constants import COLOR_CYAN, RESET_FORMAT, COLOR_YELLOW, COLOR_RED
|
from utils.constants import COLOR_CYAN, COLOR_RED, COLOR_YELLOW, RESET_FORMAT
|
||||||
from utils.input_utils import get_number_input
|
from utils.input_utils import get_number_input
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Dict, Union, Literal
|
from typing import Dict, Literal, Union
|
||||||
|
|
||||||
FileKey = Literal["filepath", "display_name"]
|
FileKey = Literal["filepath", "display_name"]
|
||||||
LogFile = Dict[FileKey, Union[str, Path]]
|
LogFile = Dict[FileKey, Union[str, Path]]
|
||||||
|
|||||||
@@ -8,13 +8,12 @@
|
|||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
from typing import Type, Optional
|
from typing import Optional, Type
|
||||||
|
|
||||||
from components.log_uploads.log_upload_utils import get_logfile_list
|
from components.log_uploads.log_upload_utils import get_logfile_list, upload_logfile
|
||||||
from components.log_uploads.log_upload_utils import upload_logfile
|
|
||||||
from core.menus import Option
|
from core.menus import Option
|
||||||
from core.menus.base_menu import BaseMenu
|
from core.menus.base_menu import BaseMenu
|
||||||
from utils.constants import RESET_FORMAT, COLOR_YELLOW
|
from utils.constants import COLOR_YELLOW, RESET_FORMAT
|
||||||
|
|
||||||
|
|
||||||
# noinspection PyMethodMayBeStatic
|
# noinspection PyMethodMayBeStatic
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
from typing import Type, Optional
|
from typing import Optional, Type
|
||||||
|
|
||||||
from components.moonraker import moonraker_remove
|
from components.moonraker import moonraker_remove
|
||||||
from core.menus import Option
|
from core.menus import Option
|
||||||
from core.menus.base_menu import BaseMenu
|
from core.menus.base_menu import BaseMenu
|
||||||
from utils.constants import RESET_FORMAT, COLOR_RED, COLOR_CYAN
|
from utils.constants import COLOR_CYAN, COLOR_RED, RESET_FORMAT
|
||||||
|
|
||||||
|
|
||||||
# noinspection PyUnusedLocal
|
# noinspection PyUnusedLocal
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import subprocess
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Union
|
from typing import List, Union
|
||||||
|
|
||||||
from components.moonraker import MOONRAKER_DIR, MOONRAKER_ENV_DIR, MODULE_PATH
|
from components.moonraker import MODULE_PATH, MOONRAKER_DIR, MOONRAKER_ENV_DIR
|
||||||
from core.config_manager.config_manager import ConfigManager
|
from core.config_manager.config_manager import ConfigManager
|
||||||
from core.instance_manager.base_instance import BaseInstance
|
from core.instance_manager.base_instance import BaseInstance
|
||||||
from utils.constants import SYSTEMD
|
from utils.constants import SYSTEMD
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from typing import List
|
|||||||
from components.klipper.klipper import Klipper
|
from components.klipper.klipper import Klipper
|
||||||
from components.moonraker.moonraker import Moonraker
|
from components.moonraker.moonraker import Moonraker
|
||||||
from core.menus.base_menu import print_back_footer
|
from core.menus.base_menu import print_back_footer
|
||||||
from utils.constants import COLOR_GREEN, RESET_FORMAT, COLOR_YELLOW, COLOR_CYAN
|
from utils.constants import COLOR_CYAN, COLOR_GREEN, COLOR_YELLOW, RESET_FORMAT
|
||||||
|
|
||||||
|
|
||||||
def print_moonraker_overview(
|
def print_moonraker_overview(
|
||||||
|
|||||||
@@ -10,30 +10,30 @@ import json
|
|||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from components.webui_client.client_utils import (
|
|
||||||
enable_mainsail_remotemode,
|
|
||||||
get_existing_clients,
|
|
||||||
)
|
|
||||||
from components.webui_client.mainsail_data import MainsailData
|
|
||||||
from core.settings.kiauh_settings import KiauhSettings
|
|
||||||
from components.klipper.klipper import Klipper
|
from components.klipper.klipper import Klipper
|
||||||
from components.moonraker import (
|
from components.moonraker import (
|
||||||
EXIT_MOONRAKER_SETUP,
|
EXIT_MOONRAKER_SETUP,
|
||||||
MOONRAKER_DIR,
|
MOONRAKER_DIR,
|
||||||
MOONRAKER_ENV_DIR,
|
MOONRAKER_ENV_DIR,
|
||||||
MOONRAKER_REQUIREMENTS_TXT,
|
MOONRAKER_REQUIREMENTS_TXT,
|
||||||
POLKIT_LEGACY_FILE,
|
|
||||||
POLKIT_FILE,
|
POLKIT_FILE,
|
||||||
POLKIT_USR_FILE,
|
POLKIT_LEGACY_FILE,
|
||||||
POLKIT_SCRIPT,
|
POLKIT_SCRIPT,
|
||||||
|
POLKIT_USR_FILE,
|
||||||
)
|
)
|
||||||
from components.moonraker.moonraker import Moonraker
|
from components.moonraker.moonraker import Moonraker
|
||||||
from components.moonraker.moonraker_dialogs import print_moonraker_overview
|
from components.moonraker.moonraker_dialogs import print_moonraker_overview
|
||||||
from components.moonraker.moonraker_utils import (
|
from components.moonraker.moonraker_utils import (
|
||||||
create_example_moonraker_conf,
|
|
||||||
backup_moonraker_dir,
|
backup_moonraker_dir,
|
||||||
|
create_example_moonraker_conf,
|
||||||
)
|
)
|
||||||
|
from components.webui_client.client_utils import (
|
||||||
|
enable_mainsail_remotemode,
|
||||||
|
get_existing_clients,
|
||||||
|
)
|
||||||
|
from components.webui_client.mainsail_data import MainsailData
|
||||||
from core.instance_manager.instance_manager import InstanceManager
|
from core.instance_manager.instance_manager import InstanceManager
|
||||||
|
from core.settings.kiauh_settings import KiauhSettings
|
||||||
from utils.common import check_install_dependencies
|
from utils.common import check_install_dependencies
|
||||||
from utils.fs_utils import check_file_exist
|
from utils.fs_utils import check_file_exist
|
||||||
from utils.git_utils import git_clone_wrapper, git_pull_wrapper
|
from utils.git_utils import git_clone_wrapper, git_pull_wrapper
|
||||||
@@ -43,10 +43,10 @@ from utils.input_utils import (
|
|||||||
)
|
)
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
from utils.sys_utils import (
|
from utils.sys_utils import (
|
||||||
parse_packages_from_file,
|
check_python_version,
|
||||||
create_python_venv,
|
create_python_venv,
|
||||||
install_python_requirements,
|
install_python_requirements,
|
||||||
check_python_version,
|
parse_packages_from_file,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,10 +12,9 @@ import subprocess
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from components.webui_client.base_data import BaseWebClient, BaseWebClientConfig
|
|
||||||
from core.settings.kiauh_settings import KiauhSettings
|
|
||||||
from components.klipper.klipper import Klipper
|
from components.klipper.klipper import Klipper
|
||||||
from components.moonraker.moonraker import Moonraker
|
from components.moonraker.moonraker import Moonraker
|
||||||
|
from components.webui_client.base_data import BaseWebClient, BaseWebClientConfig
|
||||||
from components.webui_client.client_dialogs import (
|
from components.webui_client.client_dialogs import (
|
||||||
print_client_already_installed_dialog,
|
print_client_already_installed_dialog,
|
||||||
)
|
)
|
||||||
@@ -23,8 +22,8 @@ from components.webui_client.client_utils import (
|
|||||||
backup_client_config_data,
|
backup_client_config_data,
|
||||||
config_for_other_client_exist,
|
config_for_other_client_exist,
|
||||||
)
|
)
|
||||||
|
|
||||||
from core.instance_manager.instance_manager import InstanceManager
|
from core.instance_manager.instance_manager import InstanceManager
|
||||||
|
from core.settings.kiauh_settings import KiauhSettings
|
||||||
from utils.common import backup_printer_config_dir
|
from utils.common import backup_printer_config_dir
|
||||||
from utils.config_utils import add_config_section, add_config_section_at_top
|
from utils.config_utils import add_config_section, add_config_section_at_top
|
||||||
from utils.fs_utils import create_symlink
|
from utils.fs_utils import create_symlink
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ from typing import List
|
|||||||
|
|
||||||
from components.webui_client.base_data import BaseWebClient
|
from components.webui_client.base_data import BaseWebClient
|
||||||
from core.menus.base_menu import print_back_footer
|
from core.menus.base_menu import print_back_footer
|
||||||
from utils.constants import RESET_FORMAT, COLOR_YELLOW, COLOR_CYAN
|
from utils.constants import COLOR_CYAN, COLOR_YELLOW, RESET_FORMAT
|
||||||
|
|
||||||
|
|
||||||
def print_moonraker_not_found_dialog():
|
def print_moonraker_not_found_dialog():
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ from components.webui_client.client_config.client_config_remove import (
|
|||||||
run_client_config_removal,
|
run_client_config_removal,
|
||||||
)
|
)
|
||||||
from components.webui_client.client_utils import backup_mainsail_config_json
|
from components.webui_client.client_utils import backup_mainsail_config_json
|
||||||
|
|
||||||
from core.instance_manager.instance_manager import InstanceManager
|
from core.instance_manager.instance_manager import InstanceManager
|
||||||
from utils.config_utils import remove_config_section
|
from utils.config_utils import remove_config_section
|
||||||
from utils.fs_utils import (
|
from utils.fs_utils import (
|
||||||
|
|||||||
@@ -11,27 +11,26 @@ from pathlib import Path
|
|||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from components.klipper.klipper import Klipper
|
from components.klipper.klipper import Klipper
|
||||||
|
|
||||||
from components.moonraker.moonraker import Moonraker
|
from components.moonraker.moonraker import Moonraker
|
||||||
from components.webui_client.base_data import (
|
from components.webui_client.base_data import (
|
||||||
WebClientType,
|
|
||||||
BaseWebClient,
|
BaseWebClient,
|
||||||
BaseWebClientConfig,
|
BaseWebClientConfig,
|
||||||
|
WebClientType,
|
||||||
)
|
)
|
||||||
from components.webui_client.client_config.client_config_setup import (
|
from components.webui_client.client_config.client_config_setup import (
|
||||||
install_client_config,
|
install_client_config,
|
||||||
)
|
)
|
||||||
from components.webui_client.client_dialogs import (
|
from components.webui_client.client_dialogs import (
|
||||||
print_moonraker_not_found_dialog,
|
|
||||||
print_client_port_select_dialog,
|
print_client_port_select_dialog,
|
||||||
print_install_client_config_dialog,
|
print_install_client_config_dialog,
|
||||||
|
print_moonraker_not_found_dialog,
|
||||||
)
|
)
|
||||||
from components.webui_client.client_utils import (
|
from components.webui_client.client_utils import (
|
||||||
backup_mainsail_config_json,
|
backup_mainsail_config_json,
|
||||||
restore_mainsail_config_json,
|
|
||||||
enable_mainsail_remotemode,
|
|
||||||
symlink_webui_nginx_log,
|
|
||||||
config_for_other_client_exist,
|
config_for_other_client_exist,
|
||||||
|
enable_mainsail_remotemode,
|
||||||
|
restore_mainsail_config_json,
|
||||||
|
symlink_webui_nginx_log,
|
||||||
)
|
)
|
||||||
from core.instance_manager.instance_manager import InstanceManager
|
from core.instance_manager.instance_manager import InstanceManager
|
||||||
from core.settings.kiauh_settings import KiauhSettings
|
from core.settings.kiauh_settings import KiauhSettings
|
||||||
@@ -39,23 +38,23 @@ from utils import NGINX_SITES_AVAILABLE, NGINX_SITES_ENABLED
|
|||||||
from utils.common import check_install_dependencies
|
from utils.common import check_install_dependencies
|
||||||
from utils.config_utils import add_config_section
|
from utils.config_utils import add_config_section
|
||||||
from utils.fs_utils import (
|
from utils.fs_utils import (
|
||||||
unzip,
|
|
||||||
copy_upstream_nginx_cfg,
|
|
||||||
copy_common_vars_nginx_cfg,
|
copy_common_vars_nginx_cfg,
|
||||||
|
copy_upstream_nginx_cfg,
|
||||||
create_nginx_cfg,
|
create_nginx_cfg,
|
||||||
create_symlink,
|
create_symlink,
|
||||||
remove_file,
|
|
||||||
read_ports_from_nginx_configs,
|
|
||||||
is_valid_port,
|
|
||||||
get_next_free_port,
|
get_next_free_port,
|
||||||
|
is_valid_port,
|
||||||
|
read_ports_from_nginx_configs,
|
||||||
|
remove_file,
|
||||||
|
unzip,
|
||||||
)
|
)
|
||||||
from utils.input_utils import get_confirm, get_number_input
|
from utils.input_utils import get_confirm, get_number_input
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
from utils.sys_utils import (
|
from utils.sys_utils import (
|
||||||
download_file,
|
|
||||||
set_nginx_permissions,
|
|
||||||
get_ipv4_addr,
|
|
||||||
cmd_sysctl_service,
|
cmd_sysctl_service,
|
||||||
|
download_file,
|
||||||
|
get_ipv4_addr,
|
||||||
|
set_nginx_permissions,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ from dataclasses import dataclass
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from components.webui_client.base_data import (
|
from components.webui_client.base_data import (
|
||||||
|
BaseWebClient,
|
||||||
BaseWebClientConfig,
|
BaseWebClientConfig,
|
||||||
WebClientConfigType,
|
WebClientConfigType,
|
||||||
WebClientType,
|
WebClientType,
|
||||||
BaseWebClient,
|
|
||||||
)
|
)
|
||||||
from components.webui_client.client_utils import get_download_url
|
from components.webui_client.client_utils import get_download_url
|
||||||
from core.backup_manager import BACKUP_ROOT_DIR
|
from core.backup_manager import BACKUP_ROOT_DIR
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ from dataclasses import dataclass
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from components.webui_client.base_data import (
|
from components.webui_client.base_data import (
|
||||||
|
BaseWebClient,
|
||||||
BaseWebClientConfig,
|
BaseWebClientConfig,
|
||||||
WebClientConfigType,
|
WebClientConfigType,
|
||||||
WebClientType,
|
WebClientType,
|
||||||
BaseWebClient,
|
|
||||||
)
|
)
|
||||||
from core.backup_manager import BACKUP_ROOT_DIR
|
from core.backup_manager import BACKUP_ROOT_DIR
|
||||||
|
|
||||||
|
|||||||
@@ -8,13 +8,13 @@
|
|||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
from typing import Type, Optional
|
from typing import Optional, Type
|
||||||
|
|
||||||
from components.webui_client import client_remove
|
from components.webui_client import client_remove
|
||||||
from components.webui_client.base_data import BaseWebClient, WebClientType
|
from components.webui_client.base_data import BaseWebClient, WebClientType
|
||||||
from core.menus import Option
|
from core.menus import Option
|
||||||
from core.menus.base_menu import BaseMenu
|
from core.menus.base_menu import BaseMenu
|
||||||
from utils.constants import RESET_FORMAT, COLOR_RED, COLOR_CYAN
|
from utils.constants import COLOR_CYAN, COLOR_RED, RESET_FORMAT
|
||||||
|
|
||||||
|
|
||||||
# noinspection PyUnusedLocal
|
# noinspection PyUnusedLocal
|
||||||
|
|||||||
@@ -8,11 +8,12 @@
|
|||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from abc import abstractmethod, ABC
|
|
||||||
|
from abc import ABC, abstractmethod
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
from utils.constants import SYSTEMD, CURRENT_USER
|
from utils.constants import CURRENT_USER, SYSTEMD
|
||||||
|
|
||||||
|
|
||||||
class BaseInstance(ABC):
|
class BaseInstance(ABC):
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Optional, Union, TypeVar
|
from typing import List, Optional, TypeVar, Union
|
||||||
|
|
||||||
from core.instance_manager.base_instance import BaseInstance
|
from core.instance_manager.base_instance import BaseInstance
|
||||||
from utils.constants import SYSTEMD
|
from utils.constants import SYSTEMD
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from enum import unique, Enum
|
from enum import Enum, unique
|
||||||
|
|
||||||
|
|
||||||
@unique
|
@unique
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Callable, Any, Union
|
from typing import Any, Callable, Union
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
from typing import Type, Optional
|
from typing import Optional, Type
|
||||||
|
|
||||||
from components.klipper import KLIPPER_DIR
|
from components.klipper import KLIPPER_DIR
|
||||||
from components.klipper.klipper import Klipper
|
from components.klipper.klipper import Klipper
|
||||||
|
|||||||
@@ -8,24 +8,24 @@
|
|||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
from typing import Type, Optional
|
from typing import Optional, Type
|
||||||
|
|
||||||
from components.klipper.klipper_utils import backup_klipper_dir
|
from components.klipper.klipper_utils import backup_klipper_dir
|
||||||
from components.klipperscreen.klipperscreen import backup_klipperscreen_dir
|
from components.klipperscreen.klipperscreen import backup_klipperscreen_dir
|
||||||
from components.moonraker.moonraker_utils import (
|
from components.moonraker.moonraker_utils import (
|
||||||
backup_moonraker_dir,
|
|
||||||
backup_moonraker_db_dir,
|
backup_moonraker_db_dir,
|
||||||
|
backup_moonraker_dir,
|
||||||
)
|
)
|
||||||
from components.webui_client.client_utils import (
|
from components.webui_client.client_utils import (
|
||||||
backup_client_data,
|
|
||||||
backup_client_config_data,
|
backup_client_config_data,
|
||||||
|
backup_client_data,
|
||||||
)
|
)
|
||||||
from components.webui_client.fluidd_data import FluiddData
|
from components.webui_client.fluidd_data import FluiddData
|
||||||
from components.webui_client.mainsail_data import MainsailData
|
from components.webui_client.mainsail_data import MainsailData
|
||||||
from core.menus import Option
|
from core.menus import Option
|
||||||
from core.menus.base_menu import BaseMenu
|
from core.menus.base_menu import BaseMenu
|
||||||
from utils.common import backup_printer_config_dir
|
from utils.common import backup_printer_config_dir
|
||||||
from utils.constants import COLOR_CYAN, RESET_FORMAT, COLOR_YELLOW
|
from utils.constants import COLOR_CYAN, COLOR_YELLOW, RESET_FORMAT
|
||||||
|
|
||||||
|
|
||||||
# noinspection PyUnusedLocal
|
# noinspection PyUnusedLocal
|
||||||
|
|||||||
@@ -14,14 +14,14 @@ import sys
|
|||||||
import textwrap
|
import textwrap
|
||||||
import traceback
|
import traceback
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
from typing import Type, Dict, Optional
|
from typing import Dict, Optional, Type
|
||||||
|
|
||||||
from core.menus import FooterType, Option
|
from core.menus import FooterType, Option
|
||||||
from utils.constants import (
|
from utils.constants import (
|
||||||
COLOR_GREEN,
|
|
||||||
COLOR_YELLOW,
|
|
||||||
COLOR_RED,
|
|
||||||
COLOR_CYAN,
|
COLOR_CYAN,
|
||||||
|
COLOR_GREEN,
|
||||||
|
COLOR_RED,
|
||||||
|
COLOR_YELLOW,
|
||||||
RESET_FORMAT,
|
RESET_FORMAT,
|
||||||
)
|
)
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
from typing import Type, Optional
|
from typing import Optional, Type
|
||||||
|
|
||||||
from components.crowsnest.crowsnest import install_crowsnest
|
from components.crowsnest.crowsnest import install_crowsnest
|
||||||
from components.klipper import klipper_setup
|
from components.klipper import klipper_setup
|
||||||
@@ -20,7 +20,6 @@ from components.webui_client.client_config import client_config_setup
|
|||||||
from components.webui_client.fluidd_data import FluiddData
|
from components.webui_client.fluidd_data import FluiddData
|
||||||
from components.webui_client.mainsail_data import MainsailData
|
from components.webui_client.mainsail_data import MainsailData
|
||||||
from core.menus import Option
|
from core.menus import Option
|
||||||
|
|
||||||
from core.menus.base_menu import BaseMenu
|
from core.menus.base_menu import BaseMenu
|
||||||
from utils.constants import COLOR_GREEN, RESET_FORMAT
|
from utils.constants import COLOR_GREEN, RESET_FORMAT
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
from typing import Type, Optional
|
from typing import Optional, Type
|
||||||
|
|
||||||
from components.crowsnest.crowsnest import remove_crowsnest
|
from components.crowsnest.crowsnest import remove_crowsnest
|
||||||
from components.klipper.menus.klipper_remove_menu import KlipperRemoveMenu
|
from components.klipper.menus.klipper_remove_menu import KlipperRemoveMenu
|
||||||
|
|||||||
@@ -7,16 +7,17 @@
|
|||||||
# This file may be distributed under the terms of the GNU GPLv3 license #
|
# This file may be distributed under the terms of the GNU GPLv3 license #
|
||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
|
|
||||||
import textwrap
|
|
||||||
import configparser
|
import configparser
|
||||||
|
import textwrap
|
||||||
from typing import Dict, Union
|
from typing import Dict, Union
|
||||||
|
|
||||||
from core.config_manager.config_manager import CustomConfigParser
|
from core.config_manager.config_manager import CustomConfigParser
|
||||||
from kiauh import PROJECT_ROOT
|
from utils.constants import COLOR_RED, RESET_FORMAT
|
||||||
from utils.constants import RESET_FORMAT, COLOR_RED
|
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
from utils.sys_utils import kill
|
from utils.sys_utils import kill
|
||||||
|
|
||||||
|
from kiauh import PROJECT_ROOT
|
||||||
|
|
||||||
|
|
||||||
# noinspection PyUnusedLocal
|
# noinspection PyUnusedLocal
|
||||||
# noinspection PyMethodMayBeStatic
|
# noinspection PyMethodMayBeStatic
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
# This file may be distributed under the terms of the GNU GPLv3 license #
|
# This file may be distributed under the terms of the GNU GPLv3 license #
|
||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
|
|
||||||
from abc import abstractmethod, ABC
|
from abc import ABC, abstractmethod
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,13 +12,13 @@ import inspect
|
|||||||
import json
|
import json
|
||||||
import textwrap
|
import textwrap
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Type, Dict, Optional
|
from typing import Dict, Optional, Type
|
||||||
|
|
||||||
from core.menus import Option
|
from core.menus import Option
|
||||||
|
from core.menus.base_menu import BaseMenu
|
||||||
from extensions import EXTENSION_ROOT
|
from extensions import EXTENSION_ROOT
|
||||||
from extensions.base_extension import BaseExtension
|
from extensions.base_extension import BaseExtension
|
||||||
from core.menus.base_menu import BaseMenu
|
from utils.constants import COLOR_CYAN, COLOR_YELLOW, RESET_FORMAT
|
||||||
from utils.constants import RESET_FORMAT, COLOR_CYAN, COLOR_YELLOW
|
|
||||||
|
|
||||||
|
|
||||||
# noinspection PyUnusedLocal
|
# noinspection PyUnusedLocal
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ from typing import List
|
|||||||
|
|
||||||
from components.klipper.klipper import Klipper
|
from components.klipper.klipper import Klipper
|
||||||
from core.backup_manager.backup_manager import BackupManager
|
from core.backup_manager.backup_manager import BackupManager
|
||||||
from extensions.base_extension import BaseExtension
|
|
||||||
from core.config_manager.config_manager import ConfigManager
|
from core.config_manager.config_manager import ConfigManager
|
||||||
from core.instance_manager.instance_manager import InstanceManager
|
from core.instance_manager.instance_manager import InstanceManager
|
||||||
|
from extensions.base_extension import BaseExtension
|
||||||
from extensions.gcode_shell_cmd import (
|
from extensions.gcode_shell_cmd import (
|
||||||
EXTENSION_TARGET_PATH,
|
|
||||||
EXTENSION_SRC,
|
|
||||||
KLIPPER_DIR,
|
|
||||||
EXAMPLE_CFG_SRC,
|
EXAMPLE_CFG_SRC,
|
||||||
|
EXTENSION_SRC,
|
||||||
|
EXTENSION_TARGET_PATH,
|
||||||
|
KLIPPER_DIR,
|
||||||
KLIPPER_EXTRAS,
|
KLIPPER_EXTRAS,
|
||||||
)
|
)
|
||||||
from utils.fs_utils import check_file_exist
|
from utils.fs_utils import check_file_exist
|
||||||
|
|||||||
@@ -15,12 +15,11 @@ import subprocess
|
|||||||
|
|
||||||
from extensions.base_extension import BaseExtension
|
from extensions.base_extension import BaseExtension
|
||||||
from extensions.klipper_backup import (
|
from extensions.klipper_backup import (
|
||||||
KLIPPERBACKUP_REPO_URL,
|
|
||||||
KLIPPERBACKUP_DIR,
|
|
||||||
KLIPPERBACKUP_CONFIG_DIR,
|
KLIPPERBACKUP_CONFIG_DIR,
|
||||||
|
KLIPPERBACKUP_DIR,
|
||||||
|
KLIPPERBACKUP_REPO_URL,
|
||||||
MOONRAKER_CONF,
|
MOONRAKER_CONF,
|
||||||
)
|
)
|
||||||
|
|
||||||
from utils.fs_utils import check_file_exist
|
from utils.fs_utils import check_file_exist
|
||||||
from utils.input_utils import get_confirm
|
from utils.input_utils import get_confirm
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
|
|||||||
@@ -11,20 +11,19 @@ import csv
|
|||||||
import shutil
|
import shutil
|
||||||
import textwrap
|
import textwrap
|
||||||
import urllib.request
|
import urllib.request
|
||||||
from typing import List, Union, Optional, Type
|
from typing import List, Optional, Type, TypedDict, Union
|
||||||
from typing import TypedDict
|
|
||||||
|
|
||||||
from components.klipper.klipper import Klipper
|
from components.klipper.klipper import Klipper
|
||||||
from components.klipper.klipper_dialogs import (
|
from components.klipper.klipper_dialogs import (
|
||||||
print_instance_overview,
|
|
||||||
DisplayType,
|
DisplayType,
|
||||||
|
print_instance_overview,
|
||||||
)
|
)
|
||||||
from core.menus import Option
|
|
||||||
from extensions.base_extension import BaseExtension
|
|
||||||
from core.instance_manager.base_instance import BaseInstance
|
from core.instance_manager.base_instance import BaseInstance
|
||||||
from core.instance_manager.instance_manager import InstanceManager
|
from core.instance_manager.instance_manager import InstanceManager
|
||||||
|
from core.menus import Option
|
||||||
from core.menus.base_menu import BaseMenu
|
from core.menus.base_menu import BaseMenu
|
||||||
from utils.constants import COLOR_YELLOW, COLOR_CYAN, RESET_FORMAT
|
from extensions.base_extension import BaseExtension
|
||||||
|
from utils.constants import COLOR_CYAN, COLOR_YELLOW, RESET_FORMAT
|
||||||
from utils.git_utils import git_clone_wrapper
|
from utils.git_utils import git_clone_wrapper
|
||||||
from utils.input_utils import get_selection_input
|
from utils.input_utils import get_selection_input
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
@@ -106,7 +105,7 @@ class MainsailThemeInstallMenu(BaseMenu):
|
|||||||
| {color}{header:~^{count}}{RESET_FORMAT} |
|
| {color}{header:~^{count}}{RESET_FORMAT} |
|
||||||
|-------------------------------------------------------|
|
|-------------------------------------------------------|
|
||||||
| {line1:<62} |
|
| {line1:<62} |
|
||||||
| https://docs.mainsail.xyz/theming/themes |
|
| https://docs.mainsail.xyz/theming/themes |
|
||||||
|-------------------------------------------------------|
|
|-------------------------------------------------------|
|
||||||
"""
|
"""
|
||||||
)[1:]
|
)[1:]
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
import tempfile
|
import tempfile
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, TypeVar, Tuple, Optional
|
from typing import List, Optional, Tuple, TypeVar
|
||||||
|
|
||||||
from components.klipper.klipper import Klipper
|
from components.klipper.klipper import Klipper
|
||||||
from components.moonraker.moonraker import Moonraker
|
from components.moonraker.moonraker import Moonraker
|
||||||
|
|||||||
@@ -12,16 +12,15 @@
|
|||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from zipfile import ZipFile
|
from subprocess import DEVNULL, PIPE, CalledProcessError, check_output, run
|
||||||
from subprocess import run, check_output, CalledProcessError, PIPE, DEVNULL
|
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
from zipfile import ZipFile
|
||||||
|
|
||||||
from components.klipper.klipper import Klipper
|
from components.klipper.klipper import Klipper
|
||||||
from utils import (
|
from utils import (
|
||||||
NGINX_SITES_AVAILABLE,
|
|
||||||
MODULE_PATH,
|
MODULE_PATH,
|
||||||
NGINX_CONFD,
|
NGINX_CONFD,
|
||||||
|
NGINX_SITES_AVAILABLE,
|
||||||
NGINX_SITES_ENABLED,
|
NGINX_SITES_ENABLED,
|
||||||
)
|
)
|
||||||
from utils.decorators import deprecated
|
from utils.decorators import deprecated
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ from enum import Enum
|
|||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from utils.constants import (
|
from utils.constants import (
|
||||||
COLOR_WHITE,
|
|
||||||
COLOR_GREEN,
|
|
||||||
COLOR_YELLOW,
|
|
||||||
COLOR_RED,
|
|
||||||
COLOR_MAGENTA,
|
|
||||||
RESET_FORMAT,
|
|
||||||
COLOR_CYAN,
|
COLOR_CYAN,
|
||||||
|
COLOR_GREEN,
|
||||||
|
COLOR_MAGENTA,
|
||||||
|
COLOR_RED,
|
||||||
|
COLOR_WHITE,
|
||||||
|
COLOR_YELLOW,
|
||||||
|
RESET_FORMAT,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,24 +8,22 @@
|
|||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import select
|
||||||
import shutil
|
import shutil
|
||||||
import socket
|
import socket
|
||||||
from subprocess import Popen, PIPE, CalledProcessError, run, DEVNULL
|
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import urllib.error
|
import urllib.error
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import venv
|
import venv
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from subprocess import DEVNULL, PIPE, CalledProcessError, Popen, run
|
||||||
from typing import List, Literal
|
from typing import List, Literal
|
||||||
|
|
||||||
import select
|
|
||||||
|
|
||||||
from utils.fs_utils import check_file_exist
|
from utils.fs_utils import check_file_exist
|
||||||
from utils.input_utils import get_confirm
|
from utils.input_utils import get_confirm
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
|
|
||||||
|
|
||||||
SysCtlServiceAction = Literal[
|
SysCtlServiceAction = Literal[
|
||||||
"start",
|
"start",
|
||||||
"stop",
|
"stop",
|
||||||
|
|||||||
Reference in New Issue
Block a user