feat: Add dependency management tools and enhance logging features

- Introduced `check_dependencies.py` to automate dependency checks and provide installation guidance.
- Created `install_dependencies.py` for automatic installation of missing dependencies.
- Updated `config.json` to include new logging settings for log retention and date-based log file management.
- Added `DEPENDENCY_GUIDE.md` and `DEPENDENCY_FIXES_REPORT.md` for comprehensive documentation on dependency management and fixes.
- Enhanced logging functionality in `douyin_logging.py` to support date-based log files and automatic cleanup of old logs.
This commit is contained in:
Your Name committed 2025-12-21 22:40:56 +08:00
1 parent 2cd81c05a3
commit 1a63852bde
23 files changed
+8784 -902

No files matched your search

+6 -6
View File
@@ -77,7 +77,7 @@ def write_config(cfg: dict) -> None:
class ProcRunner:
def __init__(self) -> None:
self._proc: subprocess.Popen | None = None
self._proc: Optional[subprocess.Popen] = None
self._lock = threading.Lock()
self._log: list[str] = []
self._log_capacity: int = (
@@ -85,10 +85,10 @@ class ProcRunner:
)
self._log_file_enabled: bool = True
self._log_file_path: str = os.path.join(BASE_DIR, "logs", "unified.log")
self._start_ts: float | None = None
self._last_log_ts: float | None = None
self._exit_code: int | None = None
self._pid: int | None = None
self._start_ts: Optional[float] = None
self._last_log_ts: Optional[float] = None
self._exit_code: Optional[int] = None
self._pid: Optional[int] = None
# 运行统计(基于 stdout 日志解析)
self._counters: dict[str, int] = {}
@@ -183,7 +183,7 @@ class ProcRunner:
self._wins = self._wins[-self._wins_cap :]
@staticmethod
def _parse_countdown_seconds(text: str) -> int | None: # type: ignore[misc]
def _parse_countdown_seconds(text: str) -> Optional[int]:
t = str(text or "").strip()
if not t:
return None