1
0

update readme and check

This commit is contained in:
2024-12-06 00:35:34 +01:00
parent 46bfbd5a94
commit 3408a59410
2 changed files with 35 additions and 8 deletions
+22 -2
View File
@@ -5,7 +5,6 @@ import os
import shutil
import subprocess
import configparser
import json
from pathlib import Path
from typing import Dict, List, Tuple
@@ -44,12 +43,27 @@ def check_stats_commands() -> List[Tuple[bool, str]]:
return results
def check_stats_collector_config() -> List[Tuple[bool, str]]:
"""Check if stats collector config exists."""
results = []
config_home = os.environ.get("XDG_CONFIG_HOME", os.path.expanduser("~/.config"))
config_path = Path(config_home) / "stats-collector/config.ini"
if config_path.exists():
results.append((True, "Stats collector config found"))
else:
results.append((False, f"Stats collector config not found at {config_path}"))
return results
def check_scripts() -> Dict[str, List[Tuple[bool, str]]]:
"""Run all checks for each script."""
checks = {
"av1": [
check_command("ffmpeg"),
],
"e-ink": [
check_command("python3"),
],
"indeel": [
check_command("file"),
check_command("magick"),
@@ -63,7 +77,13 @@ def check_scripts() -> Dict[str, List[Tuple[bool, str]]]:
check_env_var("PUSHOVER_USER_TOKEN"),
check_command("curl"),
],
"stats": check_stats_commands(),
"stats": [
*check_stats_commands(),
],
"stats-collector": [
check_command("python3"),
*check_stats_collector_config(),
],
"syncwall": [
check_command("wget"),
check_command("wal"),