Files
douyi_guaji_main/douyin/detection/detection_pkg
CodexandClaude Opus 4.7 273adbb677 refactor(finder): 抽 check_have_fudai_with_ready_screenshot 中"截图获取+加载+失败处理"块到 finder_screenshot
将循环每次的截图相关逻辑(约 78 行)抽到 3 个独立 helper:
- capture_screenshot_for_loop:每次循环开始时获取截图(_shot_and_diagnose + 文件验证 + 兜底)
- load_screenshot_with_retry:读取截图,失败时重新截图后重试,返回 PIL Image 或 None
- handle_screenshot_load_failure:连续失败超阈值返回 "break";否则等待后返回 "continue"

finder.py: 371 → 320 行 (-51)
新增 finder_screenshot.py: 111 行

finder.py 跌破 350 行(1438 → 320,本会话累计削减 1118 行 = -78%)

验证:
- pytest 1013 passed
- compile OK

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 14:18:35 +08:00
..