Commit Graph
4 Commits
Author SHA1 Message Date
CodexandClaude Opus 4.7 7715b93eca fix(manage_logs): 修复 douyin_logging 拆分后的 import 回归
douyin/logging/douyin_logging.py 在 e35e8a8 commit 拆分为子包后,
原文件改成 re-export shim,不再"恰好"暴露 module-level 的 path_config
和全局变量 _log_monitor。

bin/manage_logs.py 之前依赖这两个间接 import:
  from douyin.logging.douyin_logging import path_config        # 副作用
  from douyin.logging.douyin_logging import _log_monitor       # 全局变量

修复:
- path_config 改为直接从源头导入:from douyin.core import path_config
- _log_monitor 改为从子包内部状态读取:
  from douyin.logging.douyin_logging_pkg import _common as _logging_state
  _log_monitor = _logging_state._log_monitor

回归:
- bin/manage_logs.py --help / monitor / stats 三个子命令全部正常
- pytest 353 passed / 1 skipped 不变

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 17:48:17 +08:00
CodexandClaude Opus 4.7 71f3653354 补回上次合并丢失的关键路径修复 + .gitignore 补强 + 依赖版本对齐
上次冲突解决时跳过了 982f57e (P0 清理) 和 b6ae970 (路径修复) 两个 commit,
本提交补回其中影响运行时正确性和文档一致性的 7 处。

E. 路径错位修复
  - douyin/core/douyin_fudai.py: _reservations_state_path 与 room_pos_map
    状态目录改为优先调用 path_config.get_reservations_path()
  - douyin/core/path_config.py: get_reservations_path 注释明确"实际位置 + 写入方"
  - gui/components/mapping_utils.py: 删除错误兜底 douyin/state/reservations.json
  - gui/components/mapping_table.py: 同步删除 douyin/state/room_pos_map.json 错误兜底
  - gui/web_gui.py: get_reservations() 内的兜底由 douyin/state/ 修正为 douyin/core/state/
  - bin/run_cli.py: 移除对已删空文件 douyin_reservation_ops.py 的 shim 加载
  - douyin/reservation/douyin_reservation_ops.py: 删除 0 字节空文件

F. .gitignore 补强
  - 新增 *.bak_* 拦截带日期后缀的备份命名(修复 *.bak 命中失败的场景)

G. 依赖版本对齐
  - requirements-minimal.txt: paddleocr/paddlepaddle 改为 >=3.0.0,与 requirements.txt 一致
  - README.md: 安装指引中 paddlepaddle==2.5.2 改为 >=3.0.0

回归:全量 .py compileall 通过;7 项断言(path_config 路径、douyin_fudai 切换、
3 处兜底已清、shim 已移除、空文件已删、.gitignore 补强、版本对齐)全部 PASS;
test_filter_logging / check_web_gui_config_sync 通过。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 10:18:17 +08:00
CodexandClaude Opus 4.5 8fe7ff0585 refactor: 根目录核心模块迁移到 douyin/core/ 和 douyin/logging/
将 4 个根目录核心模块迁移到合理位置:
- path_config.py    -> douyin/core/path_config.py
- version.py        -> douyin/core/version.py
- Underlying_Operations.py -> douyin/core/underlying_operations.py
- unified_logger.py -> douyin/logging/unified_logger.py

配套更新所有 import:
- path_config: 41 处 import 改为 douyin.core.path_config
- version: 4 处改为 douyin.core.version
- unified_logger: 5 处改为 douyin.logging.unified_logger
- Underlying_Operations: 14 处改为 douyin.core.underlying_operations

修复 path_config.PROJECT_ROOT 计算(向上 2 级而非当前目录)。

验证:python -m compileall 全项目通过。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-21 00:23:14 +08:00
CodexandClaude Opus 4.5 e3e399da70 refactor: 入口脚本迁移到 bin/
将 4 个入口脚本从根目录迁移到 bin/:
- run_cli.py
- gui_app.py
- webgui_launcher.py
- manage_logs.py

配套修改:
- 修复 bin/*.py 内部 ROOT_DIR 计算(parent.parent)
- bin/run_cli.py 在 sys.path 加入项目根,shim 加载逻辑保持不变
- bin/manage_logs.py 在 sys.path 加入项目根
- path_config.get_run_cli_path() 返回 bin/run_cli.py

启动方式变化:
- 原: python run_cli.py / python gui_app.py
- 新: python bin/run_cli.py / python bin/gui_app.py

GUI 内部通过 path_config.get_run_cli_path() 调用,自动适配。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-21 00:23:14 +08:00