chore: format

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
dw-0
2024-03-24 00:33:09 +01:00
parent 58719a4ca0
commit e64aa94df4
14 changed files with 120 additions and 45 deletions

View File

@@ -130,9 +130,15 @@ def remove_polkit_rules() -> None:
return
try:
command = [f"{MOONRAKER_DIR}/scripts/set-policykit-rules.sh", "--clear"]
command = [
f"{MOONRAKER_DIR}/scripts/set-policykit-rules.sh",
"--clear",
]
subprocess.run(
command, stderr=subprocess.PIPE, stdout=subprocess.DEVNULL, check=True
command,
stderr=subprocess.PIPE,
stdout=subprocess.DEVNULL,
check=True,
)
except subprocess.CalledProcessError as e:
Logger.print_error(f"Error while removing policykit rules: {e}")

View File

@@ -12,7 +12,10 @@ import sys
from pathlib import Path
from components.webui_client import MAINSAIL_DIR
from components.webui_client.client_utils import enable_mainsail_remotemode, get_existing_clients
from components.webui_client.client_utils import (
enable_mainsail_remotemode,
get_existing_clients,
)
from kiauh import KIAUH_CFG
from components.klipper.klipper import Klipper
from components.moonraker import (
@@ -170,7 +173,10 @@ def install_moonraker_polkit() -> None:
try:
command = [POLKIT_SCRIPT, "--disable-systemctl"]
result = subprocess.run(
command, stderr=subprocess.PIPE, stdout=subprocess.DEVNULL, text=True
command,
stderr=subprocess.PIPE,
stdout=subprocess.DEVNULL,
text=True,
)
if result.returncode != 0 or result.stderr:
Logger.print_error(f"{result.stderr}", False)

View File

@@ -32,10 +32,12 @@ from utils.system_utils import (
)
def get_moonraker_status() -> Dict[
Literal["status", "status_code", "instances", "repo", "local", "remote"],
Union[str, int],
]:
def get_moonraker_status() -> (
Dict[
Literal["status", "status_code", "instances", "repo", "local", "remote"],
Union[str, int],
]
):
status = get_install_status_common(Moonraker, MOONRAKER_DIR, MOONRAKER_ENV_DIR)
return {
"status": status.get("status"),