mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-13 10:34:28 +05:00
fix: remove octoapp_store dir when uninstalling (#562)
Co-authored-by: dw-0 <th33xitus@gmail.com>
This commit is contained in:
committed by
GitHub
parent
ac54d04b40
commit
43d6598be6
@@ -14,7 +14,6 @@ OA_REPO = "https://github.com/crysxd/OctoApp-Plugin.git"
|
|||||||
# directories
|
# directories
|
||||||
OA_DIR = Path.home().joinpath("octoapp")
|
OA_DIR = Path.home().joinpath("octoapp")
|
||||||
OA_ENV_DIR = Path.home().joinpath("octoapp-env")
|
OA_ENV_DIR = Path.home().joinpath("octoapp-env")
|
||||||
OA_STORE_DIR = OA_DIR.joinpath("octoapp-store")
|
|
||||||
|
|
||||||
# files
|
# files
|
||||||
OA_REQ_FILE = OA_DIR.joinpath("requirements.txt")
|
OA_REQ_FILE = OA_DIR.joinpath("requirements.txt")
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import json
|
|||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from components.moonraker.moonraker import Moonraker
|
from components.moonraker.moonraker import Moonraker
|
||||||
|
from components.klipper.klipper import Klipper
|
||||||
from core.instance_manager.instance_manager import InstanceManager
|
from core.instance_manager.instance_manager import InstanceManager
|
||||||
from core.logger import DialogType, Logger
|
from core.logger import DialogType, Logger
|
||||||
from extensions.base_extension import BaseExtension
|
from extensions.base_extension import BaseExtension
|
||||||
@@ -131,6 +132,7 @@ class OctoappExtension(BaseExtension):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
self._remove_OA_instances(ob_instances)
|
self._remove_OA_instances(ob_instances)
|
||||||
|
self._remove_OA_store_dirs()
|
||||||
self._remove_OA_dir()
|
self._remove_OA_dir()
|
||||||
self._remove_OA_env()
|
self._remove_OA_env()
|
||||||
remove_config_section(f"include {OA_SYS_CFG_NAME}", mr_instances)
|
remove_config_section(f"include {OA_SYS_CFG_NAME}", mr_instances)
|
||||||
@@ -181,6 +183,21 @@ class OctoappExtension(BaseExtension):
|
|||||||
|
|
||||||
run_remove_routines(OA_DIR)
|
run_remove_routines(OA_DIR)
|
||||||
|
|
||||||
|
|
||||||
|
def _remove_OA_store_dirs(self) -> None:
|
||||||
|
Logger.print_status("Removing OctoApp for Klipper store directory ...")
|
||||||
|
|
||||||
|
klipper_instances: List[Moonraker] = get_instances(Klipper)
|
||||||
|
|
||||||
|
for instance in klipper_instances:
|
||||||
|
store_dir = instance.data_dir.joinpath("octoapp-store")
|
||||||
|
if not store_dir.exists():
|
||||||
|
Logger.print_info(f"'{store_dir}' does not exist. Skipped ...")
|
||||||
|
return
|
||||||
|
|
||||||
|
run_remove_routines(store_dir)
|
||||||
|
|
||||||
|
|
||||||
def _remove_OA_env(self) -> None:
|
def _remove_OA_env(self) -> None:
|
||||||
Logger.print_status("Removing OctoApp for Klipper environment ...")
|
Logger.print_status("Removing OctoApp for Klipper environment ...")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user