P0 死代码清理:删 .backup / 空文件 / GUI 占位桩 / 占位目录 / 失效测试

A. 删除 3 个 .backup 文件(约 3.4K 行)
  - douyin/detection/douyin_pixel.py.backup
  - douyin/stage/douyin_stage_handler.py.backup
  - gui/components/log_color_config.py.backup

B. 删除 0 字节文件
  - douyin/other/douyin_stuck_guard.py
  - docs/功能差异对比.md
  - docs/archive/模块化代码对比说明.md

C. 删除 9 个 TODO + pass 占位组件(全仓零外部引用)
  - gui/components/{config_manager,image_viewer,stats_display,
    reservation_display,high_value_rooms_display,ocr_panel,main_window}.py
  - gui/web_components/{proc_runner,http_handler}.py

D. 删除占位目录与失效测试入口
  - douyin/detection/core/  仅 re-export 占位
  - douyin/fudai/finder/    仅 re-export 占位
  - tests/run_test.py       指向已删的 deleted_tests_backup/

附加:tools/diagnostics/check_web_gui_config_sync.py --help 字符串里
      tools/web_gui_config_manifest.json 旧路径修正为 tools/dev/...

回归:154 → 141 个 .py,全量 compileall 通过;AST 扫描 0 处 import 残留;
gui.gui_app/web_gui/gui_core 仍可加载;fudai_analyse / should_skip_fudai_by_config
业务函数链路正常;test_filter_logging / check_web_gui_config_sync 通过。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
CodexandClaude Opus 4.7 committed 2026-05-21 10:36:59 +08:00
1 parent c878491163
commit 7fb0c3849c
19 files changed
+1 -3812

No files matched your search

-52
View File
@@ -1,52 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import subprocess
# 查找目标文件
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
target_dir = os.path.join(PROJECT_ROOT, "pic", "debug_captures", "2025-12-31")
if os.path.exists(target_dir):
files = os.listdir(target_dir)
# 查找包含关键字的文件
target_file = None
for f in files:
if "152118" in f and "福袋倒计时_分钟" in f and "识别后" in f and "390,1110" in f:
target_file = f
break
if target_file:
# 使用绝对路径,避免编码问题
full_path = os.path.abspath(os.path.join(target_dir, target_file))
print(f"找到文件: {target_file}")
print(f"完整路径: {full_path}")
print(f"文件存在: {os.path.exists(full_path)}")
print("\n开始运行测试...\n")
# 运行测试脚本
cmd = [
sys.executable,
"-u",
os.path.join(PROJECT_ROOT, "deleted_tests_backup", "test_real_parallel_ocr.py"),
full_path,
]
env = os.environ.copy()
env['PYTHONIOENCODING'] = 'utf-8'
env['PYTHONUNBUFFERED'] = '1'
# 实时显示输出
process = subprocess.Popen(cmd, encoding='utf-8', stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
text=True, env=env, bufsize=1, universal_newlines=True)
if process.stdout:
for line in process.stdout:
print(line, end='')
process.wait()
print(f"\n退出码: {process.returncode}")
else:
print("未找到目标文件")
print("可用文件列表(前10个):")
for f in files[:10]:
if "152118" in f:
print(f" {f}")
else:
print(f"目录不存在: {target_dir}")