Codex and Claude Opus 4.7
b8a35656a0
refactor(fudai): 拆出额外验证 + 兜底无效详情检查(1121→1084,-37 行)
...
- handle_extra_validation:调用 validate_fudai_detail,失败时关闭详情 + 写日志
- handle_invalid_detail_fallback:价值=0 且内容空时判定为"无效详情"提前 return
新增 9 个单元测试,1239 → 1248 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 04:02:01 +08:00
Codex and Claude Opus 4.7
f075f94b31
refactor(fudai): 拆出第一次打开读取/验证/筛选 + 第二次重读详情(1212→1121,-91 行)
...
- reread_detail_for_second_open_fallthrough:第二次打开兜底重读
- perform_first_open_read_validate_filter:第一次打开整套(读取 → 验证失败兜底 →
筛选 → 高价值决策 → 通过则保存)
新增 8 个单元测试覆盖各分支。1231 → 1239 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:58:19 +08:00
Codex and Claude Opus 4.7
df8424b706
refactor(fudai): 拆出高价值预约总调度(1273→1212,-61 行)
...
把 run_once_basic 中"高价值预约 + 闭包构造 + 6 个子块串联"的 67 行块抽到
fudai_run_blocks.process_high_value_reservation_check:
- 内部构造 _swipe_down_once / _sort_reservations / _write_state /
_seek_reservation_room 4 个闭包
- 串联 handle_queue_full_wait_at_earliest / log_skip_reservation_check_for_state /
handle_all_reservations_completed_reset / log_needswitch_check_details /
execute_reservation_attend_or_cleanup
新增 4 个单元测试,1227 → 1231 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:53:33 +08:00
Codex and Claude Opus 4.7
e567948ec9
refactor(fudai): 拆出 _match_icon_template 到 fudai_image_helpers(1400→1273,-127 行)
...
把 _match_icon_template(135 行)的模板匹配逻辑抽到独立模块:
- _correlation_score:归一化相关系数(去均值后点积/范数乘积)
- _sliding_search_best_score:以模板边长 // 6 为步长滑动搜索
- match_icon_template:等尺寸直接算 / 模板小于 ROI 时先中心裁剪 + 滑动兜底
新增 8 个单元测试(同图完美匹配 / 反相关 / 模板缩放 / threshold 覆盖等)。
1219 → 1227 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:50:09 +08:00
Codex and Claude Opus 4.7
f3d4621686
refactor(fudai): 拆出 _capture_roi_screenshot 到 fudai_image_helpers(1529→1400,-129 行)
...
把 _capture_roi_screenshot(141 行)的 PNG 读取/校验/裁剪逻辑抽到独立模块:
- _read_screenshot_with_validation:6 次重试 + PNG 头/尾/PIL.verify 校验
- _open_image_or_retry:解析失败时重读一次再解析
- capture_roi_screenshot:组合上述步骤,裁剪 ROI 后保存到 pic 目录
新增 11 个单元测试(端到端 PNG 读写 + 各种异常分支)。1208 → 1219 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:46:27 +08:00
Codex and Claude Opus 4.7
cc164a192f
refactor(fudai): 拆出保存详情成功 + 提取 future_ts(1556→1529,-27 行)
...
- save_first_read_detail_success:筛选通过后保存 detail + 标记 first_read + 写日志
- extract_future_ts_from_detail:从 detail 的 countdown_tuple 中提取 future_ts
新增 7 个单元测试,1201 → 1208 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:41:42 +08:00
Codex and Claude Opus 4.7
be95d9c279
refactor(fudai): 拆出 _handle_in_fudai_detail 入口诊断日志(1572→1556,-16 行)
...
log_entry_flags:进入 _handle_in_fudai_detail 时记录关键 flags 的诊断日志。
新增 2 个单元测试,1199 → 1201 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:38:23 +08:00
Codex and Claude Opus 4.7
1b4dc477fd
refactor(fudai): 拆出阶段诊断 + stage 分发块(1652→1572,-80 行)
...
- diagnose_stage_with_logging:前置预日志 + _diagnose_stage_from_current_screen +
缓存到 _last_diag_* + 写诊断结果日志
- dispatch_stage:根据 stage 分发到对应 handler,返回 bool 决定主流程是否 return
run_once_basic 主体只剩调用 + 早返回链。
新增 11 个单元测试覆盖各 stage 分支。1188 → 1199 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:34:56 +08:00
Codex and Claude Opus 4.7
47d31d34fd
refactor(fudai): 拆出队列满等待 + 状态跳过日志(1704→1652,-52 行)
...
- handle_queue_full_wait_at_earliest:队列已满时回退到最早开奖直播间等待
- log_skip_reservation_check_for_state:等待开奖/参与预约/队列满三种状态下跳过日志
新增 7 个单元测试。1181 → 1188 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:31:15 +08:00
Codex and Claude Opus 4.7
9dee41b976
refactor(fudai): 拆出 fudai_choujiang 入口的 5 个子块(1879→1704,-175 行)
...
把 fudai_choujiang 中互相独立的初始化与循环子块抽到 fudai_run_blocks:
- cleanup_old_screenshot_at_startup:启动时清理旧截图
- resolve_device_resolution:分辨率重试(含默认回退)
- write_actions_log_separator:actions.log 分隔符写入
- run_basic_loop_with_timeout:定时循环模式
- run_basic_loop_forever:无限循环模式(含 KeyboardInterrupt 处理)
主入口从 237 行降到 ~60 行。新增 9 个单元测试覆盖各分支。
1172 → 1181 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:27:34 +08:00
Codex and Claude Opus 4.7
cdcabb665d
refactor(fudai): 拆出步骤4参与成功善后处理(1939→1879,-60 行)
...
handle_attend_success_post_processing:参与决策成功后从 detail 提取倒计时、
设置等待开奖标志、调用预约善后/关闭详情/重置状态、写步骤4完成日志。
新增 5 个单元测试覆盖:join_result=False / 时间戳无变化 / 正常路径 /
remain_seconds=0 / detail 异常吞噬。1167 → 1172 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:24:02 +08:00
Codex and Claude Opus 4.7
9700813a33
refactor(fudai): 拆出高价值福袋"立即参与/记录预约"决策(2067→1939,-128 行)
...
把 _handle_in_fudai_detail 中"高价值福袋且 countdown_gt_*"的 130 行决策块抽到
fudai_detail_blocks.handle_high_value_skip_decide:
- 启用阈值检查 + 价值检查 + skip_reason 前缀检查
- 剩余秒数 ≤ join_ahead → return (False, False) 让外层走立即参与
- 剩余秒数 > join_ahead → 调用 basic_join_decision 记录预约后 return (True, True)
- 异常时 return (False, True) 让外层走默认筛选关闭路径
douyin_fudai.py 跌破 2000 行(1939)。
新增 7 个单元测试覆盖:未启用 / 价值不足 / 非倒计时 reason / 立即参与 /
记录预约 / join_decision 异常 / 外层异常吞噬。1160 → 1167 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:21:07 +08:00
Codex and Claude Opus 4.7
c75635f519
refactor(fudai): 拆出筛选不通过的关闭+切换块(2185→2067,-118 行)
...
把 _handle_in_fudai_detail 中"筛选不通过"分支(120 行 close + ADB swipe + cleanup)
抽到 fudai_detail_blocks.handle_filter_skip_close_and_switch。复用已有的
_force_swipe_to_next_live_with_adb_fallback 切换逻辑。
新增 3 个单元测试覆盖:切换 / 不切换 / close 异常吞噬。1157 → 1160 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:17:53 +08:00
Codex and Claude Opus 4.7
25c7a0440d
refactor(fudai): 拆出"第二次打开福袋详情"分支(2318→2185,-133 行)
...
把 _handle_in_fudai_detail 中"is_second_open"分支(156 行)抽到
fudai_detail_blocks.handle_second_open_attend:
- 若 _fudai_detail_first_read=True 且有保存的详情数据:直接调用 attend_choujiang
- 参与成功重置计数器;失败累加;attend_result 写入完成日志
- 异常时返回 False 让主流程落到第一次打开路径
新增 5 个单元测试覆盖:非二次打开 / 无详情 fallthrough / 有效详情参与成功 /
参与失败计数 / attend 异常 fallthrough。1152 → 1157 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:15:01 +08:00
Codex and Claude Opus 4.7
03e509ac25
refactor(fudai): 拆出预约抢占调度块(2429→2318,-111 行)
...
execute_reservation_attend_or_cleanup:根据 needswitch 分支处理:
- 多间模式:调用 process_reservation_attend_window 抢占回退
- 单间模式:仅清理过期预约
新增 4 个单元测试覆盖正/负回报值、ref 同步、cleanup 异常吞噬。
1148 → 1152 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:11:29 +08:00
Codex and Claude Opus 4.7
28f91b2aaf
refactor(fudai): 拆出 needswitch 诊断日志(2429→2390,-39 行)
...
把 run_once_basic 中"needswitch 配置 + 第一个预约详情"的诊断日志(48 行)
抽到 fudai_run_blocks.log_needswitch_check_details。纯日志辅助函数。
新增 2 个单元测试覆盖正常队列与空队列。1146 → 1148 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:08:07 +08:00
Codex and Claude Opus 4.7
970e9043cb
refactor(fudai): 拆出"所有预约完成后重置到第一个直播间"块(2460→2429,-31 行)
...
handle_all_reservations_completed_reset:当队列满等待标志开启且队列已空时,
清除 focus + 按 room_pos 次数下滑回退到第一个直播间(最多 100 次防死循环)。
新增 5 个单元测试,1141 → 1146 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:05:18 +08:00
Codex and Claude Opus 4.7
c6a4d5fb99
refactor(fudai): 拆出预约队列状态文件写入(2545→2460,-85 行)
...
把 run_once_basic 中嵌套的 _write_state 闭包(87 行 JSON 写文件 + 节流)抽到
fudai_run_blocks.write_reservations_state_throttled。原闭包改为单行调用。
新增 3 个单元测试覆盖:1秒节流跳过 / 节流过后写入 / IO 错误吞噬。
1138 → 1141 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 03:02:45 +08:00
Codex and Claude Opus 4.7
a317b38b25
refactor(fudai): 拆出预约触发条件诊断日志(2602→2545,-57 行)
...
把 run_once_basic 中"预约触发条件诊断 + 跳过原因日志"的 60 行块抽到
fudai_run_blocks.log_reservation_trigger_check。纯日志辅助函数。
新增 4 个单元测试覆盖:disabled / 空队列 / 正常队列 / 超过 3 项截断。
1134 → 1138 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 02:59:35 +08:00
Codex and Claude Opus 4.7
3473e2bd5e
refactor(fudai): 拆出 just_recorded_reservation + skip_stage_diagnosis 早返回(2661→2602,-59 行)
...
把 run_once_basic 中两个互相独立的早返回块抽到 fudai_run_blocks:
- handle_just_recorded_reservation:刚记录预约后按 needswitch 决定是否上滑切换
- handle_skip_stage_diagnosis:跳过阶段检测标志触发时直接查找福袋
新增 7 个单元测试,1127 → 1134 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 02:56:49 +08:00
Codex and Claude Opus 4.7
41fc4ecbe0
refactor(fudai): 拆出首次运行清空预约队列块(2783→2661,-122 行)
...
把 run_once_basic 中"首次运行清空预约队列与写空状态文件"的 130 行块抽到
fudai_run_blocks.maybe_clear_reservation_queue_on_first_run:
- 首次运行:清空 reservations / 写空状态文件 / 标记 _first_run_once_basic=False
- 非首次:仅记录日志保持当前队列
新增 4 个单元测试覆盖:首次清空 / 非首次保持 / 无 state_path 兜底 / 日志异常吞噬。
1123 → 1127 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 02:53:46 +08:00
Codex and Claude Opus 4.7
e6da24c2a6
refactor(fudai): 拆出截图重试块(2822→2783,-39 行)
...
把 run_once_basic 中 '截图 + 重试 + 失败诊断日志' 的 45 行块抽到
fudai_run_blocks.take_screenshot_with_retries:
- 失败时自动写入完整诊断日志(含 reservation flags / room_pos 等)
- 返回 (ok, elapsed);ok=False 时主流程直接 return
新增 4 个单元测试覆盖:首次成功 / 二次成功 / 全失败写诊断 / get_screenshot 抛错。
1119 → 1123 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 02:49:36 +08:00
Codex and Claude Opus 4.7
6cf3ce9a72
refactor(fudai): 拆出 IN_LIVE_ROOM + RECOMMEND_PAGE stage 处理(2915→2822,-93 行)
...
把 run_once_basic 中两个 stage 分支抽到 fudai_run_blocks:
- handle_in_live_room_stage:等待福袋加载(如刚切换)+ 查找福袋
- handle_recommend_page_stage:点击直播页 + 进入直播间(连点两次)
新增 5 个单元测试覆盖:刚切换 / 未切换 / 点击失败回退 / 完成日志。
1114 → 1119 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 02:46:21 +08:00
Codex and Claude Opus 4.7
992db1e161
refactor(fudai): 拆出 4 个 stage 弹窗/结束分支(2975→2915,-60 行)
...
把 run_once_basic 中 4 个 stage 分支抽到 fudai_run_blocks:
- handle_coupon_popup_stage:优惠券弹窗按返回键
- handle_shopping_redpacket_popup_stage:购物红包弹窗点击关闭
- handle_lottery_result_stage:开奖结果 OCR 识别 + 处理或回退
- handle_live_closed_stage:直播结束下滑切换
新增 7 个单元测试覆盖每个分支主路径 + 异常吞噬。1107 → 1114 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 02:43:10 +08:00
Codex and Claude Opus 4.7
1604ad1904
refactor(fudai): 拆出 FANSCLUB_JOIN stage 处理(3135→2975,-160 行)
...
把 run_once_basic 中 FANSCLUB_JOIN 分支(166 行)抽到
fudai_run_blocks.handle_fansclub_join_stage:
- 主路径:点参与按钮 + 2 次预设位置 + 关详情
- 异常路径:按 auto_join_fansclub 决定重试或等待 15s + 按 fansclub_fail_action 决定切换
douyin_fudai.py 终于跌破 3000 行(2975)。
新增 5 个单元测试覆盖:正常路径 / 自动加入重试 / 等待手动 / 失败切换 / 完成日志。
1102 → 1107 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 02:39:50 +08:00
Codex and Claude Opus 4.7
878a4c2fd9
refactor(fudai): 拆出锁定期跳过搜索块(3181→3135,-46 行)
...
把 _handle_live_room_has_or_not_fudai 中锁定期内时间窗口未到的早返回块抽到
fudai_detail_blocks.should_skip_search_in_lock_period:
- 检查 focus_until + queue_full_waiting + 队头预约时间窗口三者
- 若都满足跳过条件,记录日志后返回 True
新增 6 个单元测试覆盖各种边界(无锁定期 / 队列未满 / 队列空 / 窗口已开始 /
窗口未开始 / 无效 ft)。1096 → 1102 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 02:35:39 +08:00
Codex and Claude Opus 4.7
9c823f4874
refactor(fudai): 拆出参与成功后善后逻辑(3334→3181,-153 行)
...
把 _handle_in_fudai_detail 中参与成功分支的善后动作抽到 fudai_detail_blocks:
- handle_reservation_post_attend:清/延锁定期 + 移除完成的预约 + 重排队列
- close_detail_after_successful_attend:按 _detail_closed_by_attend 决定是否点返回键
- reset_fudai_detail_state_after_attend:清除 first_read / last_tuple / task_count 标志
主流程的参与成功分支从 ~180 行简化到 ~25 行。
新增 8 个单元测试覆盖:pending=False 跳过 / 无其他预约清 focus / 有其他预约设
保护期 / 移除已完成预约 / detail 已关闭跳过点返回 / 状态标志重置等。
1088 → 1096 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 02:32:39 +08:00
Codex and Claude Opus 4.7
c5f2bbee9c
refactor(fudai): 拆出 task_count_zero 错误分支(3502→3334,-168 行)
...
把 _handle_in_fudai_detail 中 'last_status==error 且 reason==task_count_zero'
的 165 行处理逻辑抽到 fudai_detail_blocks.handle_task_count_zero_error:
- 累加 _fudai_detail_consecutive_failures 计数
- 第 3 次连续失败:关闭详情 + 强制切换直播间(含 ADB swipe 兜底)+ 重置计数
- 单次失败:清除任务数量标志后跳过本次
新增 6 个单元测试覆盖:第 1/3 次失败 / needswitch 开关 / status 不匹配 /
extra 不是 dict 等边界。1082 → 1088 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 02:26:18 +08:00
Codex and Claude Opus 4.7
17f1977a65
refactor(fudai): 抽出 _handle_in_fudai_detail 通用清理 + 状态分支(3632→3502,-130 行)
...
发现 _handle_in_fudai_detail 中有 4 个分支重复着同一套清理动作:
'清除任务数量标志 → 写完成日志 → return'
抽出两个辅助函数到 fudai_detail_blocks:
- cleanup_and_log_completion:通用清理 + 完成日志(取代原 30+ 行重复代码块)
- handle_status_based_early_return:根据 _last_fudai_detail_status 分发到
优惠券弹窗 / 观看任务 / 验证失败三个分支(error 分支因含 ADB 调用与计数
逻辑较复杂,留在主流程)
应用到 4 处早返回:coupon_popup / watch_task / validation_failed / 验证失败 / 无效详情。
新增 9 个单元测试覆盖各分支与边界,1073 → 1082 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 02:22:16 +08:00
Codex and Claude Opus 4.7
2d971ca7d8
refactor(fudai): 拆出 _handle_in_fudai_detail 数据验证失败善后(3663→3632,-31 行)
...
handle_validation_failure_cleanup:步骤2 数据验证失败时关闭详情页 + 写日志 +
清除任务数量标志(与 detail_is_none 共享同一套清理动作)。
新增 2 个单元测试覆盖正常路径与 close 异常分支,1071 → 1073 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 02:18:08 +08:00
Codex and Claude Opus 4.7
b6cd3ac8a3
refactor(fudai): 拆出 _handle_in_fudai_detail 详情为None早返回(3687→3663,-24 行)
...
handle_detail_is_none:detail==None 时清除任务数量标志 + 写完成日志 + 早返回。
新增 3 个单元测试,1068 → 1071 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 02:15:30 +08:00
Codex and Claude Opus 4.7
18c6f7b025
refactor(fudai): 拆出 _handle_in_fudai_detail 失败计数子块(3732→3687,-45 行)
...
把 _handle_in_fudai_detail 中连续参与失败次数过多的早返回块抽到
fudai_detail_blocks.handle_too_many_consecutive_failures:
- 检查 _consecutive_attend_failures 是否超阈值
- 关闭详情页 → 按 needswitch 决定切换 → 重置计数器
- 返回 True 让主流程 return
新增 5 个单元测试覆盖阈值边界 / 切换开关 / 异常兜底,1063 → 1068 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 02:11:44 +08:00
Codex and Claude Opus 4.7
0bdc378252
refactor(fudai): 拆出 run_once_basic 4 个独立子块(4121→3732,-389 行)
...
把 run_once_basic 中互相独立的 4 个块抽到 fudai_run_blocks:
- handle_waiting_for_lottery_result(等待开奖期间的持续 OCR 检测)
- handle_no_attend_timeout(30 分钟未参与超时回到推荐页)
- handle_desktop_recovery(误返回桌面后的自救路径)
- handle_high_value_room_revisit(高价值房间重访检查)
每个函数返回 bool:True=主流程应 return,False=继续下一阶段。
原方法只剩调用 + 早返回,可读性大幅提升。
新增 13 个单元测试覆盖 4 个块的核心分支,1013 → 1026 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 01:40:23 +08:00
Codex and Claude Opus 4.7
d5c9936c88
gui_app + base_interface: 内部错误 print → logger
...
gui/gui_app.py(8 处 sys.stderr print → _LOGGER):
- 配置读取失败、日志文件权限/写入错误(warning/error 级)
- pump_logs 内日志插入失败、循环异常、调度下次更新失败(error/warning 级)
- 顶部 import logging + 模块级 _LOGGER
douyin/core/fudai_modules/base_interface.py(2 处 print → _LOGGER):
- BaseFudaiMixin._safe_log 在主类无 _enhanced_log_kv 时的兜底改为 logger.info
- 顶部 import logging + 模块级 _LOGGER
保留为 stdout 的合理场景:
- bin/run_cli.py 的 [TEST]/[YANGHAO-ONLY] CLI 输出
- bin/manage_logs.py 的 CLI 工具输出
- gui/webgui_launcher.py: GUI 同时把 log 输出到控制台
- douyin/logging/internal_loggers.py: logger 模块自身的初始化失败兜底
- douyin/logging/douyin_logging{,_wrapper}.py: 日志系统内部的格式化输出
回归:140 .py 编译通过;test_filter_logging / check_web_gui_config_sync 通过;
gui.gui_app/web_gui/gui_core/base_interface 全部可加载,_LOGGER 名称正确。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 11:43:44 +08:00
Codex and Claude 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
Your Name
fb0c07c91a
Add shopping red packet detection tests and sample image
...
- Implemented a test script for shopping red packet detection using pixel analysis and OCR.
- Created a sample image to simulate a shopping red packet for testing purposes.
- Added functions to test pixel detection, coordinate definitions, and OCR keyword matching.
- Included detailed print statements for test results and summaries.
2026-01-08 20:37:49 +08:00
Your Name
4f74a5e95a
chore: remove generated reports and logs from repo, update .gitignore
2026-01-03 11:22:41 +08:00
Your Name
488f6a1fdf
chore: remove generated reports and logs from repo, update .gitignore
2026-01-03 11:22:33 +08:00
Your Name
0b5f150691
Refactor and clean up code across multiple scripts
...
- Removed trailing whitespace and ensured files end with a single newline in cleanup_unused_files.py.
- Added fix_trailing_whitespace.py to batch remove trailing whitespace from Python files.
- Updated install_dependencies.py to improve dependency installation prompts.
- Cleaned up pick_coords.py by removing unnecessary whitespace and improving code readability.
- Enhanced region_selector.py by disabling specific pylint checks for better compatibility with third-party libraries.
- Improved WPS流程图生成工具.py by cleaning up whitespace and enhancing readability.
- Updated __init__.py in typings to remove unnecessary lines.
- Modified app.js to adjust default configuration values and clean up unused code.
2026-01-02 23:57:03 +08:00
Your Name
9131c48633
Refactor screenshot service for improved performance and error handling; add simplified version to avoid linter issues. Update tests and documentation accordingly.
2026-01-02 02:17:33 +08:00
Your Name
a0aad21835
feat: Optimize ADB exec-out and OCR performance
...
- Introduced performance enhancements for ADB exec-out, reducing execution time by 10-20% through the use of Popen with streaming reads, increased buffer sizes, and removal of unnecessary fsync calls.
- Implemented optimizations in OCR processing, cutting recognition time by 50% by refining button recognition logic and improving image loading and preprocessing methods.
- Added detailed performance diagnostics and configuration options to facilitate further optimizations.
- Created new documentation files outlining the performance improvements and recommendations for future enhancements.
2026-01-02 02:06:01 +08:00
Your Name
c7b5d6be0f
后台保存debug图像
2026-01-01 13:25:50 +08:00
Your Name
7b93413af7
回退到直接截图
2026-01-01 11:30:59 +08:00
Your Name
478ae69052
chore: Clean up blank lines and enhance code organization
...
- Removed excessive blank lines from multiple Python scripts and configuration files to improve readability and maintainability.
- Ensured consistent formatting across the project, contributing to a more organized codebase.
- Added new files for testing and analysis, including `test_screenshot_error_handling.py` and `test_screenshot_reuse_optimization.py`, to improve testing coverage and functionality.
2026-01-01 10:04:32 +08:00
Your Name
07c387751d
chore: Clean up blank lines across multiple files to enhance readability
...
- Removed excessive blank lines in various Python scripts, markdown files, and configuration files to improve overall code clarity and maintainability.
- Ensured consistent formatting throughout the project, contributing to a more organized codebase.
2025-12-31 17:00:58 +08:00
Your Name
ace3bbfa04
优化后台截图功能
2025-12-31 11:55:01 +08:00
Your Name
223c127e11
chore: Clean up and refactor codebase for improved maintainability
...
- Removed obsolete command-line test parameters from `run_cli.py` to streamline functionality.
- Introduced a new `ocr_preprocess.py` module for unified OCR image preprocessing, enhancing recognition stability.
- Updated various components to utilize the new preprocessing function, improving code organization and readability.
- Adjusted configuration values in `config.json` for better performance and consistency.
- Added comprehensive technical documentation for the Douyin project, detailing code modification standards and operational guidelines.
- Cleaned up excessive blank lines across multiple files to enhance overall readability.
2025-12-30 23:11:34 +08:00
Your Name
efe6e2252f
feat: Add logging and error handling enhancements
...
- Introduced new logging modules for action tracking, error logging, and performance tracking to improve observability.
- Added functions for retrieving debug and error log paths in `path_config.py`.
- Updated various components to utilize the new logging system, enhancing error handling and performance diagnostics.
- Implemented a GUI component for viewing error logs, improving user experience in monitoring application issues.
- Cleaned up unnecessary blank lines and improved code readability across multiple files.
2025-12-29 20:48:09 +08:00
Your Name
bdf9312bc9
chore: Remove obsolete scripts and enhance path configuration
...
- Deleted `check_md_files.py` and `fix_cursor_md_issue.py` as they are no longer needed.
- Added new functions in `path_config.py` for better path management, including actions log and run_cli paths.
- Updated various modules to utilize the new path configuration, ensuring consistency and maintainability across the project.
2025-12-28 20:55:34 +08:00
Your Name
26df350755
feat: Implement 30-minute timeout protection and unify path configurations
...
- Introduced a 30-minute timeout mechanism to prevent the script from getting stuck in invalid states, with configurable timeout settings.
- Unified path configurations across the project to enhance maintainability and avoid hardcoded paths.
- Updated documentation and flowcharts to reflect the new timeout feature and improved path management.
- Fixed issues with template and screenshot path configurations to ensure consistency across the project.
2025-12-28 14:47:31 +08:00