Files
douyin_guaji-main/gui
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
..

GUI 目录

本目录包含项目的所有图形用户界面相关文件。

文件列表

  • gui_app.py - 主GUI应用程序(基于tkinter/ttkbootstrap)
  • gui_core.py - GUI核心功能模块(参数处理、设备管理、配置读写等)
  • web_gui.py - Web GUI服务器
  • webgui_launcher.py - Web GUI启动器

使用方法

桌面GUI

python gui/gui_app.py

Web GUI

python gui/webgui_launcher.py