Commit Graph
27 Commits
Author SHA1 Message Date
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 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
CodexandClaude 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
Codex e7a7d3f888 Fix device selection and adb command safety 2026-05-20 18:43:58 +08:00
Your Name d057c1d84e 优化:调整WiFi ADB连接逻辑,支持ip:port格式;改进USB设备选择逻辑,增强连接稳定性 2026-01-25 15:33:32 +08:00
Your Name 4903e50ff2 优化:调整代码格式,增强可读性 2026-01-23 15:29:09 +08:00
Your Name 6ecd9fa1ae refactor: 优化代码格式,提升可读性 2026-01-08 20:39:04 +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 b3011dd9ce feat: Implement high-value room revisit feature and enhance fudai tracking
- Added tracking for previously seen fudai in Runner and ProcRunner classes to avoid duplicate recognition.
- Extracted room title during fudai recognition for better tracking.
- Updated high_value_rooms.json with new room entries and adjusted total count.
- Introduced new GUI elements for configuring icon coordinates in webui.
- Created comprehensive documentation for the high-value room revisit functionality.
- Added tests for delay settings and icon detection logic to ensure functionality.
- Implemented a tool for analyzing step times in logs to identify performance bottlenecks.
2026-01-08 14:27:38 +08:00
Your Name 5738d29bd6 feat: 添加预约回退功能完整测试脚本和错误场景测试脚本 2026-01-08 00:15:00 +08:00
Your Name 93d47a16d6 Refactor reservation preemption handling and logging
- Removed the reservation preempt minimum value from the Runner and GUI components.
- Updated logging mechanism to streamline log message handling and improve readability.
- Introduced a new method for appending log lines in the Runner class.
- Cleaned up related GUI elements and configuration options in web interface.
- Deleted obsolete simulation scripts related to reservation preemption checks.
2026-01-07 21:24:10 +08:00
Your Name c6eb76845f feat: 优化代码格式,提升可读性和一致性 2026-01-06 22:39:58 +08:00
Your Name 68295e564e feat: 优化配置和日志提取逻辑,增强用户体验和数据准确性 2026-01-06 22:39:27 +08:00
Your Name dcded08796 feat: enhance swipe and back navigation logic
- Adjusted configuration for reset after swipes to 10 seconds and added action to go back.
- Updated flow control to skip back action if a recent reset was triggered within 5 seconds.
- Implemented a mechanism to enable back navigation when consecutive misses reach a threshold.
- Added GUI options to enable or disable back navigation on misses, ensuring consistency with user settings.
- Introduced new diagnostic tools for runtime flag checks and screenshot diagnostics.
- Created PowerShell scripts for restoring Start Menu shortcuts and performing system health checks.
- Added tests for swipe operations and back navigation to validate new logic.
2026-01-06 16:55:00 +08:00
Your Name 5e94990275 feat: 添加启用返回键回退的配置选项,优化无福袋处理逻辑 2026-01-05 22:57:01 +08:00
Your Name 43e39f4db6 feat: 添加工具以查找重复的异常处理,增强代码质量检查;新增验证 GUI 回退方式的自检脚本 2026-01-05 21:32:50 +08:00
Your Name 6121154370 feat: 更新配置文件路径,重构配置管理逻辑,增强配置文件的兼容性和可读性 2026-01-04 16:27:19 +08:00
Your Name e771197a3a feat: 增强直播间去重统计逻辑,添加当前直播间位置和相关集合 2026-01-04 15:45:01 +08:00
Your Name d81eea63c9 feat: 添加唯一计数去重功能,优化福袋相关统计逻辑 2026-01-04 09:42:47 +08:00
Your Name 90b7daa84e feat: 添加唯一计数去重功能,优化胜利记录逻辑 2026-01-04 09:38:27 +08:00
Your Name 6a59365aae feat: 添加推荐页养号功能,支持只养号模式及相关配置 2026-01-03 20:59:27 +08:00
Your Name 95b4517bdd feat: Enhance logging and parameter tracking capabilities
- Refactor `gui_core.py` to improve code readability and maintainability by adding line breaks for long statements.
- Introduce `inspect_lines.py` script for inspecting specific line ranges in files.
- Add `generate_param_locations.py` to scan the repository and generate a report of function definitions, argparse parameters, and tracking calls.
- Implement `param_usage_tool.py` for analyzing `param_usage.json` records and scanning code for tracking calls.
- Create `simulate_reservation_preempted_flow.py` and `simulate_reservation_preempted_flow_dynamic.py` to validate behavior of reservation logic under specific conditions.
- Add global parameter tracking feature in `run_cli.py` to enable detailed usage tracing.
2026-01-03 19:12:58 +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 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 c67f22f76f feat: Refactor and reorganize project structure with new modules and files
- Deleted obsolete files including test scripts and configuration files to streamline the project.
- Introduced new modules for handling Douyin functionalities, including core operations, logging, and GUI components.
- Updated import paths to reflect the new module structure, enhancing code organization and maintainability.
- Added configuration files and documentation to support the new structure and improve user guidance.
2025-12-28 14:16:40 +08:00