21 Commits
Author SHA1 Message Date
CodexandClaude Opus 4.7 0c62696118 P3: 清理过期 TODO + 修正过期路径注释
- operations/__init__.py:
  - 模块描述里 "Underlying_Operations.py 模块化" 改为
    "douyin/core/underlying_operations.py 模块化拆分"(原文件已迁移)
  - 删除 "TODO: 逐步迁移后改为从子模块导入"——
    导入是有意保留的向后兼容层,不是待办

- douyin/reservation/core/__init__.py:
  - 删除 "临时导入" "TODO: 迁移完成后改为从子模块导入"
  - 这个 re-export 层也是有意保留的向后兼容设计

回归:140 .py 编译通过;operations + reservation.core 模块加载 OK;
test_filter_logging / check_web_gui_config_sync 通过。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 12:13:31 +08:00
Codex 0131be7869 切换 OCR 默认引擎到 PaddleOCR v4-mobile 并简化预处理
- 默认引擎改为 PaddleOCR PP-OCRv4_mobile(实测 369ms/张,比 EasyOCR 629ms 更快且精度大幅提升,coupon 等关键图错字一片 -> 全对)
- EasyOCR 仅作回退,移除"小图自动放大+锐化+对比度增强"预处理(实测对 Paddle 是负优化,会引入伪影/重复字)
- analyse_pic_word 加 LRU 内容哈希缓存(256 条),重复读图直接命中
- analyse_pic_digits 从 200 行重复实现精简成 30 行委托 + 数字过滤
- 统一两处 OCR 初始化为 _build_paddle / _build_easyocr 工厂,消除重复
- 设置 FLAGS_use_mkldnn=false 绕开 Win + Paddle 3.x 的 oneDNN+PIR 不兼容 bug(实测 FLAGS_enable_pir_in_executor=0 也修不掉,关 oneDNN 是当前唯一可行解)
- 决策依据/速度数据/已知问题归档到 docs/ocr_engine_decision.md
- 业务接口完全向后兼容
2026-05-21 10:50:30 +08:00
zzz 2e811e71b3 Merge branch 'main' into claude/wonderful-brattain-d1cfe0 2026-05-21 09:58:24 +08:00
CodexandClaude Opus 4.7 96f8600d42 小批量收尾:删除零引用 scrcpy_screenshot + douyin_fudai/log_viewer print→logger
- 删除 operations/scrcpy_screenshot.py(100 行,仅自身定义自身使用,全仓零外部引用)
- douyin/core/douyin_fudai.py:3 处兜底 print → logging.info/warning(_log_kv 失败时的兜底路径)
- gui/components/log_viewer.py:2 处错误 print → _LOGVIEW_LOGGER.exception(日志线程异常 / 刷新显示异常)

回归:149→148 .py,全量编译通过;test_filter_logging / check_web_gui_config_sync 通过;
fudai_analyse 类正常导出,log_viewer 模块加载 OK。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 09:40:18 +08:00
CodexandClaude Opus 4.7 5a381698d8 operations/{screenshot,ocr}_operations: print → logging
- screenshot_operations.py: 19 处 print → _ops_log(带 [截图]/[截图操作] 前缀)
- ocr_operations.py: 7 处 print → _ocr_log(带 [OCR] 前缀)
- 两处都新增模块级 logger + 兜底 helper,与 douyin_yanghao / screenshot_service
  采用相同模式

回归:149 .py 编译通过;test_filter_logging / check_web_gui_config_sync 通过;
ScreenshotOperations、analyse_pic_word 仍可正常加载。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 09:38:07 +08:00
CodexandClaude Opus 4.7 4557dfb306 operations/screenshot_service: print → logging
- 新增模块级 _svc_log(msg, level):统一走 logging,失败兜底 stdout
- 全部 24 处 print 改为 _svc_log,保留消息中"[截图服务]"前缀以兼容历史搜索
- 默认 level=INFO,告警分级(WARNING/ERROR 等)后续再细化

回归:149 .py 全量编译通过;test_filter_logging / check_web_gui_config_sync 通过。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 09:37:56 +08:00
CodexandClaude Opus 4.5 9edfcc2449 chore: 删除 operations/ 下的废弃存根模块
- device_operations.py:仅是空 stub(__all__ = []),无人使用
- image_operations.py:同上
- screenshot_service_new.py:未被引用的重复实现

operations/__init__.py 不导出这些模块,外部无依赖。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-21 09:22:56 +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
CodexandClaude Opus 4.5 1dea80d5be fix: 截图服务添加 atexit 优雅关闭
ScreenshotService 在进程退出时通过 atexit 钩子停止后台线程,
避免 daemon 线程被强杀导致的资源泄漏。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-20 22:48:43 +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