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