 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 |
|