Your Name
|
32e374e2c2
|
refactor(gui): 抽行为日志工具栏到 components/actions_log_toolbar (1649 → 1571)
|
2026-05-30 16:45:02 +08:00 |
|
Your Name
|
aa0f4e05f2
|
refactor(gui): 抽中奖记录 Tab 整段 UI 到 components/win_record_tab (1739 → 1649)
|
2026-05-30 16:40:49 +08:00 |
|
Your Name
|
5e3015f59b
|
refactor(gui): 抽日志搜索工具栏到 components/log_search_toolbar (1813 → 1739)
|
2026-05-30 16:36:43 +08:00 |
|
Your Name
|
dc1744a93f
|
refactor(gui): 重排 log_text 创建到搜索栏之前(为下一步抽搜索栏铺路)
|
2026-05-30 16:33:00 +08:00 |
|
Your Name
|
b686a4e3d5
|
refactor(gui): 抽 log_text 颜色配置到 components/log_text_colors (1878 → 1813)
|
2026-05-30 16:29:27 +08:00 |
|
Your Name
|
29cef2c578
|
refactor(gui): 抽 realtime_tab UI 创建到 components/realtime_tab (2037 → 1878)
|
2026-05-30 16:25:51 +08:00 |
|
Your Name
|
e784efd5f8
|
refactor(gui): 抽 filter_tab UI 创建到 components/filter_tab (2122 → 2037)
|
2026-05-30 16:18:29 +08:00 |
|
Your Name
|
6c7bbf0945
|
refactor(gui): 抽 run_tab UI 创建到 components/run_tab (2192 → 2122)
|
2026-05-30 16:15:24 +08:00 |
|
Your Name
|
fe27063913
|
refactor(gui): 抽 reservation_tab UI 创建到 components/reservation_tab (2334 → 2192)
|
2026-05-30 16:11:47 +08:00 |
|
Your Name
|
3f04bb23c2
|
refactor(gui): 抽 yanghao_tab UI 创建到 components/yanghao_tab (2456 → 2334)
|
2026-05-30 16:06:40 +08:00 |
|
Your Name
|
bcb0e363d1
|
refactor(gui): 抽 logging_tab UI 创建到 components/logging_tab (2656 → 2456)
|
2026-05-30 15:54:46 +08:00 |
|
Your Name
|
b447b6a6a4
|
refactor(gui): 抽 debug_tab UI 创建到 components/debug_tab (3052 → 2656)
|
2026-05-30 15:50:58 +08:00 |
|
Your Name
|
6bac014c3d
|
refactor(gui): 抽 load_config_to_ui + save_ui_to_config 到 components/config_io (3538 → 3052)
|
2026-05-30 15:41:27 +08:00 |
|
Your Name
|
f6d382b0e7
|
refactor(gui): 抽 get_params 到 components/run_params_builder (3563 → 3538)
|
2026-05-30 15:26:17 +08:00 |
|
Your Name
|
2a05be2319
|
refactor(gui): 抽 save_logging_config 到 components/logging_config_io (3590 → 3563)
|
2026-05-30 15:22:29 +08:00 |
|
Your Name
|
97935d9c48
|
refactor(gui): 抽 _generic_search_widget 到 components/text_search (3669 → 3590)
|
2026-05-30 15:16:42 +08:00 |
|
Your Name
|
64c210dd5a
|
refactor(gui): 抽 refresh_run_log 到 components/run_log_view (3715 → 3669)
|
2026-05-30 15:12:38 +08:00 |
|
Your Name
|
68d1224b53
|
refactor(gui): 抽 _on_scan_one_click + _handle_scan_result 到 components/wifi_adb_one_click_scan (3775 → 3715)
|
2026-05-30 15:08:35 +08:00 |
|
Your Name
|
92d524297b
|
refactor(gui): 抽预览 Tab 全部 8 个动作到 components/preview_view (3891 → 3775)
|
2026-05-30 15:03:45 +08:00 |
|
Your Name
|
59ebe8c1e7
|
refactor(gui): 抽 win_record Tab 全部 7 个动作到 components/win_record_view (4044 → 3891)
|
2026-05-30 14:53:11 +08:00 |
|
Your Name
|
a7ef92fc7c
|
refactor(gui): 抽 pump_logs 到 components/log_pump (4117 → 4044)
|
2026-05-30 14:37:03 +08:00 |
|
Your Name
|
c5df7a05d2
|
refactor(gui): 抽 update_ocr_results 到 components/ocr_results_view (4148 → 4117)
|
2026-05-30 14:30:42 +08:00 |
|
Your Name
|
b3380042b8
|
refactor(gui): 抽 _try_reconnect_last_wifi 到 components/wifi_adb_reconnect (4268 → 4148)
|
2026-05-30 14:24:19 +08:00 |
|
Your Name
|
4993fad004
|
refactor(gui): 抽 _open_scan_pick_dialog 到 components/wifi_adb_pick_dialog (4337 → 4268)
|
2026-05-30 14:18:19 +08:00 |
|
Your Name
|
44b091466d
|
refactor(gui): 抽 actions_log 视图相关到 components/actions_log_view (4463 → 4337)
|
2026-05-30 14:10:30 +08:00 |
|
Your Name
|
8ea676562c
|
refactor(gui): 抽 do_screenshot + OCR_REGIONS 到 components/screenshot_action (4635 → 4463)
|
2026-05-30 14:03:31 +08:00 |
|
Your Name
|
a07ef00b5e
|
refactor(gui): 抽 refresh_high_value_rooms 到 components/high_value_view (4656 → 4635)
|
2026-05-30 13:56:36 +08:00 |
|
Your Name
|
5329561b3a
|
refactor(gui): 抽 refresh_reservations 到 components/reservations_view (4913 → 4656)
|
2026-05-30 13:52:39 +08:00 |
|
Your Name
|
6bffcae2de
|
refactor(gui): 抽 open_wifi_adb_dialog 到 components/wifi_adb_dialog (5274 → 4913)
|
2026-05-30 13:48:22 +08:00 |
|
Your Name
|
ac464788e1
|
refactor(gui): 抽 open_scan_dialog 到 components/wifi_adb_scan_dialog (5476 → 5274)
|
2026-05-30 13:43:17 +08:00 |
|
 CodexandClaude Sonnet 4.5
|
b1fa6af9ce
|
fix(gui): 修复启动后 GUI 卡死约 1.2 秒
delayed_refresh_preview 在 mainloop 启动 300ms 后同步加载大图(PIL
Image.open + load + convert),阻塞主线程。改为:
1. 延迟到 3 秒后再触发预览(GUI 已完全初始化)
2. 图片加载放到后台线程,完成后通过 root.after 回主线程更新
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
2026-05-23 21:58:50 +08:00 |
|
 CodexandClaude Opus 4.7
|
fe97e82104
|
fix(gui): 实时查看器/状态 Tab 的耗时解析支持 ms 单位
问题:实际 actions.log 写的是 `耗时=10.00ms`(毫秒),但 _parse_minimal
和 parse_action_duration 的正则只匹配 `s`,导致:
- 实时查看弹窗永远显示"暂无动作"
- 实时状态 Tab 同样空白
同时存在的副 bug:兜底正则在整行匹配,前缀里的 `192.168.5.2:5555` /
日志时间戳 `2026-05-21` 都可能被误识别成耗时。
修复:
- 解析窗口限定到 line.find("耗时") 之后的子串 (tail)
- 优先匹配 ms(顺序很重要:\s*s 会先吃掉 "10ms" 的 m)
- s 单位加 (?![a-zA-Z]) 负向后顾,避免匹配 "ms" / "second" 之类
- 同步修复 gui_app.py:3685 的 parse_action_duration(实时状态 Tab)
测试:
- _parse_minimal 加 4 个新测试覆盖 ms / 整数 ms / 优先级 / 前缀干扰
- 全量 1426 passed (+5)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-23 09:08:58 +08:00 |
|
 CodexandClaude Opus 4.7
|
4277bf7fa4
|
fix(gui): WiFi 扫描显示 adb 真实返回,state=failed 不再误导为"请授权"
问题:扫描提示 "192.168.5.2:5555 当前状态=failed,请先在手机上授权后重试",
但 failed 表示 adb connect 既不成功也不是 unauthorized(通常是 adb 服务异常 /
设备短暂不可达),不是授权问题。手机不会弹窗,用户照提示去手机上找授权窗
口,永远不会成功。
修复:
- _handle_scan_result: 区分 failed 分支,逐项打印 adb 真实返回(去掉换行
方便单行显示),并提示用户排查 adb 服务而非"请授权"。
- _open_scan_pick_dialog: 表格新增 "adb 返回" 列(截断 200 字符);
Toplevel 拓宽到 680x320 容纳新列。
- use_selected: 根据 state 给出针对性提示——unauthorized 让用户授权,
failed 显示对应 message,其他状态保持通用提示。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-23 08:55:15 +08:00 |
|
 CodexandClaude Opus 4.7
|
ca6c2e4d20
|
fix(gui): 恢复运行日志 Tab 搜索工具栏定义
d759921 抽 _open_realtime_viewer_impl 时误删了紧随其后的 16 行
"搜索工具栏"块(log_search_frame / log_filter_var / log_search_var /
log_search_entry),导致 gui_app 启动时在 L3964 报
NameError: name 'log_search_entry' is not defined。
恢复这 16 行到原位置,gui_app 可正常启动。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-23 08:37:30 +08:00 |
|
 CodexandClaude Opus 4.7
|
d759921442
|
refactor(gui): 抽 _open_realtime_viewer_impl 到 components/realtime_viewer (5539 → 5370)
gui_app.py 嵌套函数 _open_realtime_viewer_impl 是 170 行的"实时查看"对话框:
弹 Toplevel 显示当前 pic/screenshot.png + 列表展示 actions.log 中含"耗时"的
最近 80 行,每秒刷新。
抽到 gui/components/realtime_viewer.py:
- open_realtime_viewer(root) 主入口
- _tail_read(path, max_bytes) 末尾字节读取
- _parse_minimal(line) 提取 (动作名, 耗时) 二元组
- 全局单例 _active_win 替代原嵌套 def 的属性式 _win
gui_app.py 中嵌套 def 缩成 4 行委托。
新增 13 个单元测试覆盖 _tail_read 4 种情况 + _parse_minimal 8 种格式。
1421 passed (+13)。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-23 03:47:58 +08:00 |
|
 CodexandClaude Opus 4.7
|
be1eb6eda7
|
refactor(web_gui): 抽 ProcRunner._update_stats_from_line 解析逻辑到 stats_log_parser (2429 → 1806)
ProcRunner._update_stats_from_line 是 624 行的"日志行 → 计数器更新"方法,与
gui_core.Runner 同名方法行为接近但有差异:
- web_gui 解析 traceId / MDC 信息(gui_core 没有)
- web_gui 没有 _lock / _last_log_ts 字段(不需要锁保护)
- web_gui 没有 unique_keys_* / *_room_pos 这些去重数据结构
- web_gui 有"进入直播间到识别福袋耗时"事件解析
抽到独立的 gui/web_gui_pkg/stats_log_parser.py(不与 gui_core_pkg 版本共享,
避免在两边各加缺失字段,行为差异显式保留在两个文件中):
- update_stats_from_line(runner, line) 主入口
- 16 个 _parse_* 子函数(含 traceId/MDC、enter_to_fudai_seen 等 web_gui 专属段)
ProcRunner._update_stats_from_line 从 624 行变成 4 行委托。
1408 passed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-23 03:41:52 +08:00 |
|
 CodexandClaude Opus 4.7
|
3b8f85b9cb
|
refactor(gui_core): 抽 _update_stats_from_line 解析逻辑到 stats_log_parser (1207 → 541)
Runner._update_stats_from_line 是 666 行的"日志行 → 计数器更新"巨型方法。
按业务事件分类 14 个独立段(福袋字段 / 打开-参与计数器 / 跳过原因 /
错误统计 / 粉丝团 / 预约 / 开奖结果 / 直播间切换 / 阶段诊断 / OCR / 性能 /
详情识别 / 福袋查找 / 回退操作)。
抽到 gui/gui_core_pkg/stats_log_parser.py:
- update_stats_from_line(runner, line) 主入口
- 14 个 _parse_* 子函数按事件分组
- 通过 runner.* 调用保持与原 Runner 方法/状态一致
Runner._update_stats_from_line 从 666 行变成 4 行委托。模块级测试更易于
单独覆盖各分类的解析逻辑。
1408 passed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-23 03:35:04 +08:00 |
|
 CodexandClaude Opus 4.7
|
fb35670032
|
refactor(gui): 抽 ThreadSafeLogWriter 到 components/log_writer (5649 → 5537)
gui_app.py 的 ThreadSafeLogWriter 类(109 行)是自包含的日志文件写入器:
threading.Lock 保护、按日期分割、配置开关、PermissionError/Exception 兜底。
抽到 gui/components/log_writer.py,原 gui_app 中的 109 行类定义 + 1 行实例化
替换为 3 行导入 + 实例化。read_config 通过 staticmethod _read_config 延迟导入,
避免循环依赖。
新增 15 个单元测试覆盖:
- __init__:默认 log_dir / 配置开关 / dated_logs / 相对路径解析 / 配置异常兜底
- write:正常写 / 禁用跳过 / 空行跳过 / 时间戳前缀 / 已格式化行原样写
- 100 线程 × 10 行的并发安全测试(确认 1000 行无丢失)
- PermissionError / 通用异常下不抛 + warn 一次
1408 passed (+15)。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-23 03:29:25 +08:00 |
|
 CodexandClaude Opus 4.7
|
230c0d4049
|
refactor(gui): 抽 refresh_stats 字符串格式化到 stats_formatter (6339 → 5634)
gui_app.py 的 refresh_stats 闭包是 705 行纯字符串构建:把 runner.get_stats()
的字典格式化成多个分段(基本信息/快速汇总/核心统计/跳过/OCR/详情/福袋查找/
性能/粉丝团/切换/预约/错误/价值/最近福袋/中奖记录)。
抽到 gui/components/stats_formatter.py:
- format_stats(stats: Dict) -> List[str] 主入口
- 14 个 _append_* 子段构建器(每段一个,按需追加)
- _section_lines(title, body) 标题包装
闭包改为 16 行委托:调 format_stats + 写入 ScrolledText。
新增 32 个单元测试覆盖:
- 空 dict / 缺字段时的兜底
- 基本运行状态(uptime / pid / exit_code 各种格式)
- 各分段的"有数据 / 无数据"条件
- 关键率计算(打开成功率/点击率/参与成功率/中奖率/跳过率/错误频率)
- 边界情况(attend_ok > clicks 检测到已参与,结果未开奖警告,wins 截断到 10 条)
1393 passed (+32)。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-23 03:23:53 +08:00 |
|
 CodexandClaude Opus 4.7
|
52b811d0cb
|
feat(scan): WiFi-ADB 扫描支持自定义/多端口(覆盖 Android 11+ 随机端口)
之前只扫 5555。Android 11+ "无线调试" 用 37000-44999 随机端口,
固定的 adb tcpip 也可改端口。新接口让扫描适配任意端口规格。
新增 parse_port_spec:解析端口规格字符串
- 5555 单端口
- "5555,5556" 逗号分隔
- "37000-37010" 范围(最大 1024 个)
- 混合格式与序列输入
- 非法/越界 → 退化为默认 5555
- 单个范围 > 1024 端口直接忽略,避免误扫整个端口段
scan_open_ports 重构:
- 接受 ports 参数(list[int]),传 ports 时优先于旧 port=int
- 返回 list[(ip, port)] 而不是 list[ip],按 (IP 数值序, port 升序) 稳定排序
discover_adb_devices 支持 ports 参数,按 (ip, port) 逐个 verify_adb_target
接入 GUI 与 webui:
- gui_app.py 扫描对话框新增"端口"输入框 + 提示
- gui_app.py 启动重连:上次端口非 5555 时把它一并扫描
- web_gui.py /api/wifi/scan 接受 ports;/api/wifi/auto-reconnect 同上次端口逻辑
新增 13 个 parse_port_spec 单测 + 4 个 scan_open_ports 多端口测试 +
2 个 discover_adb_devices 多端口集成测试。
真机验证:6 端口 (5555 + 37000-37005) × 254 IP,~8.5s 扫完,
正确发现 192.168.5.2:5555 (PEPM00)。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-23 01:02:48 +08:00 |
|
 CodexandClaude Opus 4.7
|
cea3aced73
|
feat(web_gui): WebUI 启动时自动重连上次 WiFi 设备 + 智能匹配
新增 /api/wifi/auto-reconnect 端点,把桌面 GUI 的 _try_reconnect_last_wifi
逻辑搬到服务端:先 verify_adb_target 上次的 target → 失败则 discover_adb_devices
扫描 + pick_best_match 智能匹配。返回结构化 JSON 让前端渲染:
action: noop | already_online | reconnected | matched | failed
target / model / message / devices
webui/app.js DOMContentLoaded 末尾调用 tryAutoReconnectLastWifi(),
不阻塞页面加载。命中后自动刷新设备下拉并选中。
至此桌面 GUI 和 WebUI 在 WiFi 重连体验上完全对齐:换网段也能找回手机。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-22 20:53:23 +08:00 |
|
 CodexandClaude Opus 4.7
|
5966f461c3
|
feat(wifi_adb): 启动重连失败时自动扫描子网 + 智能匹配
新增 pick_best_match(devs, last) 纯函数,按优先级匹配上次设备:
1. target 完全一致(IP 没换)
2. 同 model + 同 port(换 IP 但同一台手机)—— 多台同型号时返回 None 让用户选
3. 同主机段 + 同 port(弱兜底,仅唯一时返回)
4. 唯一一台 connected(扫到就一台时认定)
GUI _try_reconnect_last_wifi 流程升级:
- verify_adb_target 失败(不可达)→ 自动 discover_adb_devices 扫子网
- pick_best_match 命中 → 选中 + 更新 last_wifi_target
- 命中且 IP 已变 → 日志写"上次目标 X 已变 → 智能匹配到 Y(已更新记忆)"
- 没命中 → 列出候选 + 提示点'扫描 WiFi'手选
实际场景:换 WiFi 网段(家里 → 公司 / 192.168.1 → 192.168.5)后
GUI 启动时自动找回同一台手机,无需任何手动操作。
新增 15 个 pick_best_match 单元测试覆盖所有规则 + 边界。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-22 20:46:23 +08:00 |
|
 CodexandClaude Opus 4.7
|
8c3a162deb
|
feat(web_gui): WebGUI 对齐桌面 GUI 的 WiFi 扫描和 last_wifi_target 能力
新增 4 个端点:
- POST /api/wifi/scan 扫描局域网 ADB 设备
- GET /api/wifi/last 查询上次连接记录
- POST /api/wifi/last 同上(POST 方便 fetch)
- POST /api/wifi/last/clear 清除记录
同步 connect / disconnect 路径行为:
- /api/wifi/connect 成功后写入 last_wifi_target(取设备型号)
- /api/wifi/disconnect 如果断的就是上次记住的设备 → 自动清除记录
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-22 20:33:22 +08:00 |
|
 CodexandClaude Opus 4.7
|
b3a41db029
|
feat(wifi_adb): WiFi-ADB 设置对话框三个连接路径都记 last_wifi_target
补齐之前 main commit a71f6fa 漏的几处:
- "连接"按钮:成功后保存 ip:port + 设备型号到 last_wifi_target
- "自动连接"按钮:从 USB → WiFi 切换成功后保存
- "断开连接"按钮:如果断开的就是上次记住的 IP,清掉记录避免下次启动徒劳重试
行为现在统一:所有"连上一台 WiFi 设备"的入口都会更新记忆,所有"主动断开"
的入口都会清除记忆。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-22 20:21:24 +08:00 |
|
 CodexandClaude Opus 4.7
|
a71f6faed0
|
feat(wifi_adb): 记住上次成功的 WiFi 设备,GUI 启动时自动重连
新增 gui/gui_core_pkg/config.py 三个 helper:
- get_last_wifi_target / set_last_wifi_target / clear_last_wifi_target
配置以 last_wifi_target = {target, model, saved_at} 形式存在 config.json 顶层。
GUI 行为:
- "扫描 WiFi" 选中或自动连上一台 connected 设备 → 写入 last_wifi_target
- WiFi 选择对话框"使用选中"也写入
- 主窗口启动后延迟 300ms 后台尝试 verify_adb_target(last.target)
- 已有设备:不打扰
- 重连成功:自动设为当前设备
- unauthorized:提示需手机端授权
- 不可达:提示换网了,引导点'扫描 WiFi'
新增 12 个 last_wifi_target 单元测试覆盖读写/清除/损坏值/缺文件等场景。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-22 20:16:37 +08:00 |
|
 CodexandClaude Opus 4.7
|
db7a78876b
|
feat(gui): 主窗口加"扫描 WiFi"一键按钮
主窗口设备行的"刷新设备"按钮旁加"扫描 WiFi"按钮。后台线程扫描局域网,
按结果数智能处理:
- 0 个发现 → 日志提示
- 1 个 connected → 自动设为当前设备
- N 个 unauthorized → 提示需手机端授权
- 多个候选 → 弹简化版列表对话框让用户选
省去打开 WiFi-ADB 设置对话框的步骤,常见单机场景一键完成。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-22 20:09:01 +08:00 |
|
 CodexandClaude Opus 4.7
|
e89393693b
|
feat(wifi_adb): 加局域网 ADB 设备扫描发现
新增 gui/gui_core_pkg/wifi_adb_scan.py(356 行):
- get_local_subnet:从本机 WLAN 出口 IP 推 /24 子网
- parse_subnet_spec:解析 192.168.5.0/24 / 192.168.5.1-100 / 192.168.5.5 / 逗号组合
- probe_adb_port:并发 TCP 探测(默认 0.3s 超时,64 线程并发)
- verify_adb_target:对每个开放端口的 IP 调 adb connect 区分 connected / unauthorized / failed
- discover_adb_devices:主入口,端到端只需 1.5 秒扫完 /24
GUI(gui/gui_app.py)"扫描局域网"按钮加在 WiFi 设备操作区:
- 自动推子网(默认)+ 手动输入支持 CIDR / 范围 / 单 IP / 逗号
- 后台线程扫描,进度条 + 阶段提示
- 列表展示 IP / 状态 / 设备型号 / adb connect 输出,列表中手动选
- 选中已 connected 的设备 → 回填 IP 到主对话框
- unauthorized 设备明确提示需手机端授权
新增 25 个 wifi_adb_scan 单元测试。真机端到端验证通过:1.5s 扫完
192.168.5.0/24 子网,发现 192.168.5.2:5555(PEPM00)connected。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-22 19:59:19 +08:00 |
|
 CodexandClaude Opus 4.7
|
23d370ae22
|
fix(wifi_adb): 修 3 处导致 WiFi-ADB 自动连接失败的解析 bug
1) get_device_ip 把 ip route 输出里的网段当 IP 返回
原代码看到 "192.168.5.0/24 ... src 192.168.5.2" 时,扫到的第一个含 3 个点的字段是
"192.168.5.0/24",结果用 0/24 当 IP 调 adb connect 必然失败。
改成显式从 "src <ip>" 取,并优先 wlan 接口;加 ip addr show / ifconfig 兜底。
2) auto_connect_wifi_adb 顺序错误
原代码先 tcpip 5555(让设备 adbd 重启、USB 链路断开)再 get_device_ip(需要 USB),
USB 已断必然取不到 IP。改成先 get_device_ip 再 enable_wifi_adb 再 connect。
3) connect_wifi_adb 把"未授权 / 连接被拒"当成功
adb connect 在 unauthorized / cannot connect / failed to authenticate 等场景下
returncode 也是 0;以前只看 returncode + "connected" 子串,未授权也判成功。
改成显式列出失败关键词,并对未授权给清晰的中文提示。
新增 20 个 wifi_adb 单元测试覆盖 3 处回归场景。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-22 19:32:04 +08:00 |
|
 CodexandClaude Opus 4.7
|
a6bbdcc400
|
拆分 web_gui (2251 → 5 子模块 + 2148 行原文件保留 ProcRunner/Handler/main)
把 gui/web_gui.py 中 11 个独立 helper 拆出到 gui/web_gui_pkg/ 子包,
ProcRunner 巨型类(1514 行 / 25 实例方法 / 390 处 self)+ Handler 类
(588 行)+ main 留在原文件。
新建子包:
- logger (29) _wg_log + module logger
- ansi (17) strip_ansi_escape_codes + _ANSI_ESCAPE_RE
- adb_compat (44) 5 个 thin wrapper(forward 到 gui.gui_core_pkg)
- nested (18) get_nested_value(点号路径配置读取)
- stats_helpers (71) _parse_countdown_seconds / _bucket / _inc_map(ProcRunner 3 个 @staticmethod)
策略:8 个顶层 helper 直接搬子包;ProcRunner 内 3 个 @staticmethod 也搬,
类内改成 1 行 @staticmethod forwarding 保持 ProcRunner._parse_countdown_seconds
等调用兼容。原文件 import gui.web_gui_pkg 暴露 11 个公共符号。
外部 import 路径全部不变:
- find_adb_executable / read_config / list_adb_devices 等共 70+ 处外部引用
全部不需修改(CONFIG_PATH 17 处 / read_config 17 处 / find_adb_executable
18 处 / list_adb_devices 21 处 / write_config 10 处 / 其他 1-7 处)
回归:
- 6 个新文件 + 改写后 web_gui.py compileall 通过
- pytest 353 passed / 1 skipped
- _wg_log / strip_ansi_escape_codes / get_nested_value 调用结果正确
- ProcRunner._parse_countdown_seconds('1:30') = 90 (薄壳 forwarding OK)
- ProcRunner._bucket(15, [0,10,50,100]) = '10-50'
- ProcRunner._inc_map(m, 'k', 5) -> {'k': 5}
- ProcRunner() 实例化 OK
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-21 18:57:52 +08:00 |
|
 CodexandClaude Opus 4.7
|
ef6ca4a650
|
拆分 gui_core (1594 → 4 子模块 + 1207 行原文件保留 Runner)
把 gui/gui_core.py 中 12 个独立顶层函数 + RunParams dataclass 拆出到
gui/gui_core_pkg/ 子包;Runner 巨型类(1164 行 / 13 实例方法 / 用 self
状态)原文件保留,仅做 import re-export。
新建子包:
- adb (79) find_adb_executable / list_adb_devices / resolve_adb_device
- wifi_adb (323) 7 个 WiFi-ADB 函数
- config (46) CONFIG_PATH / read_config / write_config
- run_params (45) RunParams dataclass
策略:Runner 类内部用了 find_adb_executable 等顶层函数,所以原文件
``gui/gui_core.py`` 通过 ``from gui.gui_core_pkg import *`` re-export
14 个公共符号供 Runner 内部和外部代码继续使用。
外部 import 路径全部不变:
``from gui.gui_core import find_adb_executable / RunParams / Runner`` 等
所有 14 个公共符号都保留。
- find_adb_executable 20 处外部引用 / read_config 17 处 / list_adb_devices
16 处 / 其他 1-7 处,全部不需修改
回归:
- 5 个新文件 + 改写后 gui_core.py compileall 通过
- pytest 353 passed / 1 skipped
- find_adb_executable() 调用正常返回 adb.EXE 绝对路径
- read_config() 读到 126 个 config keys
- RunParams.is_dataclass = True,28 个字段
- Runner 类正确暴露
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-21 18:49:05 +08:00 |
|