mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-25 16:53:36 +05:00
Compare commits
4 Commits
v6.0.0-alp
...
93ab78a88f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93ab78a88f | ||
|
|
3963d1174d | ||
|
|
a272bf7e41 | ||
|
|
41d3d749b0 |
@@ -40,7 +40,6 @@ from core.submodules.simple_config_parser.src.simple_config_parser.simple_config
|
||||
)
|
||||
from core.types.component_status import ComponentStatus
|
||||
from utils.common import check_install_dependencies, get_install_status
|
||||
from utils.fs_utils import check_file_exist
|
||||
from utils.input_utils import get_confirm, get_number_input, get_string_input
|
||||
from utils.instance_utils import get_instances
|
||||
from utils.sys_utils import cmd_sysctl_service, parse_packages_from_file
|
||||
@@ -207,7 +206,7 @@ def install_klipper_packages() -> None:
|
||||
packages.append("pkg-config")
|
||||
|
||||
# Add dbus requirement for DietPi distro
|
||||
if check_file_exist(Path("/boot/dietpi/.version")):
|
||||
if Path("/boot/dietpi/.version").exists():
|
||||
packages.append("dbus")
|
||||
|
||||
check_install_dependencies({*packages})
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
# ======================================================================= #
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
@@ -30,15 +29,15 @@ def check_file_exist(file_path: Path, sudo=False) -> bool:
|
||||
:return: True, if file exists, otherwise False
|
||||
"""
|
||||
if sudo:
|
||||
command = ["sudo", "find", file_path.as_posix()]
|
||||
try:
|
||||
command = ["sudo", "find", file_path.as_posix()]
|
||||
check_output(command, stderr=DEVNULL)
|
||||
return True
|
||||
except CalledProcessError:
|
||||
return False
|
||||
else:
|
||||
if os.access(file_path, os.F_OK):
|
||||
return file_path.exists()
|
||||
if file_path.exists():
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user