mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-21 06:43:37 +05:00
fix: test if checks is empty
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -6,12 +6,13 @@
|
|||||||
# #
|
# #
|
||||||
# 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 __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Dict, List, Literal, Optional, Set
|
from typing import Dict, List, Literal, Set
|
||||||
|
|
||||||
from components.klipper.klipper import Klipper
|
from components.klipper.klipper import Klipper
|
||||||
from components.moonraker.moonraker import Moonraker
|
from components.moonraker.moonraker import Moonraker
|
||||||
@@ -89,9 +90,9 @@ def check_install_dependencies(
|
|||||||
|
|
||||||
def get_install_status(
|
def get_install_status(
|
||||||
repo_dir: Path,
|
repo_dir: Path,
|
||||||
env_dir: Optional[Path] = None,
|
env_dir: Path | None = None,
|
||||||
instance_type: type | None = None,
|
instance_type: type | None = None,
|
||||||
files: Optional[List[Path]] = None,
|
files: List[Path] | None = None,
|
||||||
) -> ComponentStatus:
|
) -> ComponentStatus:
|
||||||
"""
|
"""
|
||||||
Helper method to get the installation status of software components
|
Helper method to get the installation status of software components
|
||||||
@@ -123,7 +124,7 @@ def get_install_status(
|
|||||||
checks.append(f.exists())
|
checks.append(f.exists())
|
||||||
|
|
||||||
status: StatusCode
|
status: StatusCode
|
||||||
if all(checks):
|
if checks and all(checks):
|
||||||
status = 2 # installed
|
status = 2 # installed
|
||||||
elif not any(checks):
|
elif not any(checks):
|
||||||
status = 0 # not installed
|
status = 0 # not installed
|
||||||
|
|||||||
Reference in New Issue
Block a user