mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-24 16:23:36 +05:00
refactor: rename filesystem_utils to fs_utils and system_utils to sys_utils
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -28,7 +28,7 @@ from utils.git_utils import (
|
|||||||
)
|
)
|
||||||
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.system_utils import (
|
from utils.sys_utils import (
|
||||||
check_package_install,
|
check_package_install,
|
||||||
install_system_packages,
|
install_system_packages,
|
||||||
parse_packages_from_file,
|
parse_packages_from_file,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ from components.klipper import KLIPPER_DIR, KLIPPER_ENV_DIR
|
|||||||
from components.klipper.klipper import Klipper
|
from components.klipper.klipper import Klipper
|
||||||
from components.klipper.klipper_dialogs import print_instance_overview
|
from components.klipper.klipper_dialogs import print_instance_overview
|
||||||
from core.instance_manager.instance_manager import InstanceManager
|
from core.instance_manager.instance_manager import InstanceManager
|
||||||
from utils.filesystem_utils import remove_file
|
from utils.fs_utils import remove_file
|
||||||
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
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ from core.instance_manager.instance_manager import InstanceManager
|
|||||||
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.system_utils import (
|
from utils.sys_utils import (
|
||||||
parse_packages_from_file,
|
parse_packages_from_file,
|
||||||
create_python_venv,
|
create_python_venv,
|
||||||
install_python_requirements,
|
install_python_requirements,
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ from utils.constants import CURRENT_USER
|
|||||||
from utils.git_utils import get_repo_name, get_remote_commit, get_local_commit
|
from utils.git_utils import get_repo_name, get_remote_commit, get_local_commit
|
||||||
from utils.input_utils import get_confirm, get_string_input, get_number_input
|
from utils.input_utils import get_confirm, get_string_input, get_number_input
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
from utils.system_utils import control_systemd_service
|
from utils.sys_utils import control_systemd_service
|
||||||
|
|
||||||
|
|
||||||
def get_klipper_status() -> (
|
def get_klipper_status() -> (
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ from components.klipper_firmware.flash_options import (
|
|||||||
)
|
)
|
||||||
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
|
||||||
from utils.system_utils import log_process
|
from utils.sys_utils import log_process
|
||||||
|
|
||||||
|
|
||||||
def find_firmware_file() -> bool:
|
def find_firmware_file() -> bool:
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ 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, RESET_FORMAT, COLOR_GREEN, COLOR_RED
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
from utils.system_utils import (
|
from utils.sys_utils import (
|
||||||
check_package_install,
|
check_package_install,
|
||||||
update_system_package_lists,
|
update_system_package_lists,
|
||||||
install_system_packages,
|
install_system_packages,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ from components.klipper.klipper_dialogs import print_instance_overview
|
|||||||
from components.moonraker import MOONRAKER_DIR, MOONRAKER_ENV_DIR
|
from components.moonraker import MOONRAKER_DIR, MOONRAKER_ENV_DIR
|
||||||
from components.moonraker.moonraker import Moonraker
|
from components.moonraker.moonraker import Moonraker
|
||||||
from core.instance_manager.instance_manager import InstanceManager
|
from core.instance_manager.instance_manager import InstanceManager
|
||||||
from utils.filesystem_utils import remove_file
|
from utils.fs_utils import remove_file
|
||||||
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
|
||||||
|
|
||||||
|
|||||||
@@ -35,14 +35,14 @@ from components.moonraker.moonraker_utils import (
|
|||||||
backup_moonraker_dir,
|
backup_moonraker_dir,
|
||||||
)
|
)
|
||||||
from core.instance_manager.instance_manager import InstanceManager
|
from core.instance_manager.instance_manager import InstanceManager
|
||||||
from utils.filesystem_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
|
||||||
from utils.input_utils import (
|
from utils.input_utils import (
|
||||||
get_confirm,
|
get_confirm,
|
||||||
get_selection_input,
|
get_selection_input,
|
||||||
)
|
)
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
from utils.system_utils import (
|
from utils.sys_utils import (
|
||||||
parse_packages_from_file,
|
parse_packages_from_file,
|
||||||
create_python_venv,
|
create_python_venv,
|
||||||
install_python_requirements,
|
install_python_requirements,
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ from core.instance_manager.instance_manager import InstanceManager
|
|||||||
from utils.common import get_install_status_common
|
from utils.common import get_install_status_common
|
||||||
from utils.git_utils import get_repo_name, get_local_commit, get_remote_commit
|
from utils.git_utils import get_repo_name, get_local_commit, get_remote_commit
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
from utils.system_utils import (
|
from utils.sys_utils import (
|
||||||
get_ipv4_addr,
|
get_ipv4_addr,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ from components.moonraker.moonraker import Moonraker
|
|||||||
from components.webui_client.base_data import BaseWebClientConfig
|
from components.webui_client.base_data import BaseWebClientConfig
|
||||||
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.filesystem_utils import remove_file
|
from utils.fs_utils import remove_file
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ from components.webui_client.client_utils import (
|
|||||||
from core.instance_manager.instance_manager import InstanceManager
|
from core.instance_manager.instance_manager import InstanceManager
|
||||||
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.filesystem_utils import create_symlink
|
from utils.fs_utils import create_symlink
|
||||||
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
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ 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.filesystem_utils import (
|
from utils.fs_utils import (
|
||||||
remove_nginx_config,
|
remove_nginx_config,
|
||||||
remove_nginx_logs,
|
remove_nginx_logs,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ from core.settings.kiauh_settings import KiauhSettings
|
|||||||
from utils import NGINX_SITES_AVAILABLE, NGINX_SITES_ENABLED
|
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.filesystem_utils import (
|
from utils.fs_utils import (
|
||||||
unzip,
|
unzip,
|
||||||
copy_upstream_nginx_cfg,
|
copy_upstream_nginx_cfg,
|
||||||
copy_common_vars_nginx_cfg,
|
copy_common_vars_nginx_cfg,
|
||||||
@@ -51,7 +51,7 @@ from utils.filesystem_utils import (
|
|||||||
)
|
)
|
||||||
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.system_utils import (
|
from utils.sys_utils import (
|
||||||
download_file,
|
download_file,
|
||||||
set_nginx_permissions,
|
set_nginx_permissions,
|
||||||
get_ipv4_addr,
|
get_ipv4_addr,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ from typing import List, Optional, Union, TypeVar
|
|||||||
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
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
from utils.system_utils import control_systemd_service
|
from utils.sys_utils import control_systemd_service
|
||||||
|
|
||||||
T = TypeVar(name="T", bound=BaseInstance, covariant=True)
|
T = TypeVar(name="T", bound=BaseInstance, covariant=True)
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ from core.config_manager.config_manager import CustomConfigParser
|
|||||||
from kiauh import PROJECT_ROOT
|
from kiauh import PROJECT_ROOT
|
||||||
from utils.constants import RESET_FORMAT, COLOR_RED
|
from utils.constants import RESET_FORMAT, COLOR_RED
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
from utils.system_utils import kill
|
from utils.sys_utils import kill
|
||||||
|
|
||||||
|
|
||||||
# noinspection PyUnusedLocal
|
# noinspection PyUnusedLocal
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ from extensions.gcode_shell_cmd import (
|
|||||||
EXAMPLE_CFG_SRC,
|
EXAMPLE_CFG_SRC,
|
||||||
KLIPPER_EXTRAS,
|
KLIPPER_EXTRAS,
|
||||||
)
|
)
|
||||||
from utils.filesystem_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
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ from extensions.klipper_backup import (
|
|||||||
MOONRAKER_CONF,
|
MOONRAKER_CONF,
|
||||||
)
|
)
|
||||||
|
|
||||||
from utils.filesystem_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
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ class KlipperbackupExtension(BaseExtension):
|
|||||||
Logger.print_error("Unable to remove the Klipper-Backup cron entry")
|
Logger.print_error("Unable to remove the Klipper-Backup cron entry")
|
||||||
|
|
||||||
# Remove Moonraker entry
|
# Remove Moonraker entry
|
||||||
Logger.print_status(f"Check for Klipper-Backup moonraker entry ...")
|
Logger.print_status("Check for Klipper-Backup moonraker entry ...")
|
||||||
try:
|
try:
|
||||||
if remove_moonraker_entry():
|
if remove_moonraker_entry():
|
||||||
Logger.print_ok("Klipper-Backup entry in moonraker.conf removed")
|
Logger.print_ok("Klipper-Backup entry in moonraker.conf removed")
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ from utils.constants import (
|
|||||||
COLOR_GREEN,
|
COLOR_GREEN,
|
||||||
COLOR_RED,
|
COLOR_RED,
|
||||||
)
|
)
|
||||||
from utils.filesystem_utils import check_file_exist
|
from utils.fs_utils import check_file_exist
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
from utils.system_utils import check_package_install, install_system_packages
|
from utils.sys_utils import check_package_install, install_system_packages
|
||||||
|
|
||||||
|
|
||||||
def get_current_date() -> Dict[Literal["date", "time"], str]:
|
def get_current_date() -> Dict[Literal["date", "time"], str]:
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ from typing import List, Literal
|
|||||||
|
|
||||||
import select
|
import select
|
||||||
|
|
||||||
from utils.filesystem_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
|
||||||
|
|
||||||
Reference in New Issue
Block a user