chore: 整理 tools/ 47 个脚本按功能分组
- diagnostics/ 11 个:环境/配置/依赖诊断 - logs/ 7 个:日志分析与查看 - coords/ 6 个:坐标拾取与区域选择 - cleanup/ 3 个:代码清理工具 - adb/ 2 个:ADB / 输入法相关 - windows/ 4 个:Windows 系统修复(备份) - dev/ 9 个:开发辅助 / 运行时探测 并更新 tools/README.md 描述新结构。 删除 3 个明显的临时调试脚本 (_dump_lines.py / tmp_*.py)。 tools/ 不被业务代码 import,分组仅为人工浏览方便。 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a2d6bd2cc3
commit
a19fa35a0f
46 files changed
+30
-71
No files matched your search
+30
-13
@@ -1,21 +1,38 @@
|
||||
tools/scan_coords.py — 坐标/ROI 扫描工具
|
||||
# tools/ 工具脚本目录
|
||||
|
||||
用途
|
||||
按功能分组组织,与主代码分离。tools/ 不被业务代码 import。
|
||||
|
||||
- 扫描仓库中疑似硬编码坐标或裁剪区域(如 `(100, 200)`、`(x1,y1,x2,y2)`)的代码行。
|
||||
- 输出 CSV 到 `tools/coords_report.csv`,便于人工或脚本进一步审查。
|
||||
## 目录结构
|
||||
|
||||
用法
|
||||
| 子目录 | 用途 | 典型脚本 |
|
||||
|--------|------|----------|
|
||||
| `diagnostics/` | 环境/配置/依赖诊断 | `check_system_config.py`、`check_dependencies.py`、`diagnose_runtime_flags.py` |
|
||||
| `logs/` | 日志分析与查看 | `analyze_step_times.py`、`color_log_viewer.py`、`log_filter.py` |
|
||||
| `coords/` | 坐标拾取与区域选择 | `pick_coords.py`、`region_selector.py`、`scan_coords.py` |
|
||||
| `cleanup/` | 代码清理工具 | `cleanup_unused_files.py`、`fix_trailing_whitespace.py` |
|
||||
| `adb/` | ADB / 输入法相关 | `auto_connect_wifi_adb.py`、`ADBKeyboard.apk` |
|
||||
| `windows/` | Windows 系统修复脚本 | `fix_start_menu_win11.ps1` 等(与本项目无关,仅备份) |
|
||||
| `dev/` | 开发辅助 / 运行时探测 | `param_usage_tool.py`、`simulate_swipe_trigger.py`、`merge_configs.py` |
|
||||
|
||||
## 常用入口
|
||||
|
||||
```powershell
|
||||
python tools/scan_coords.py
|
||||
# 系统/依赖诊断
|
||||
python tools/diagnostics/check_system_config.py
|
||||
python tools/diagnostics/check_dependencies.py
|
||||
|
||||
# 坐标扫描
|
||||
python tools/coords/scan_coords.py
|
||||
|
||||
# 日志分析
|
||||
python tools/logs/log_filter.py
|
||||
python tools/logs/color_log_viewer.py
|
||||
|
||||
# 参数使用追踪
|
||||
python tools/dev/param_usage_tool.py show --limit 200
|
||||
```
|
||||
|
||||
输出
|
||||
## 注意
|
||||
|
||||
- `tools/coords_report.csv` 包含字段:`file,line,match,context`。
|
||||
|
||||
注意
|
||||
|
||||
- 本脚本使用简单正则匹配,可能存在误报/漏报,建议在生成报告后人工复核。
|
||||
- 可根据需要扩展正则或关键词列表以覆盖更多模式。
|
||||
- `windows/` 下的脚本是本机环境的修复工具,与抖音挂机功能无关,保留作为环境备份。
|
||||
- `coords/scan_coords.py` 输出 `tools/coords/coords_report.csv`(已 gitignore),人工核查用。
|
||||
@@ -1,7 +0,0 @@
|
||||
import sys
|
||||
|
||||
p = "douyin/other/douyin_yanghao.py"
|
||||
with open(p, "rb") as f:
|
||||
lines = f.read().splitlines()
|
||||
for i in range(959, 979):
|
||||
print(f"{i+1:4}: {lines[i]!r}")
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,37 +0,0 @@
|
||||
from douyin.logging import douyin_logging
|
||||
import logging
|
||||
import logging.handlers as lh
|
||||
|
||||
# Configure logging using current config
|
||||
douyin_logging.configure_logging()
|
||||
root = logging.getLogger()
|
||||
print("handlers:", [type(h).__name__ for h in root.handlers])
|
||||
|
||||
for h in root.handlers:
|
||||
fname = getattr(h, "baseFilename", getattr(h, "filename", None))
|
||||
print(type(h).__name__, fname)
|
||||
# RotatingDatedFileHandler specific
|
||||
if hasattr(h, "max_bytes"):
|
||||
print(
|
||||
" max_bytes =",
|
||||
getattr(h, "max_bytes", None),
|
||||
"backup_count =",
|
||||
getattr(h, "backup_count", None),
|
||||
)
|
||||
# RotatingFileHandler
|
||||
if isinstance(h, lh.RotatingFileHandler):
|
||||
print(
|
||||
" RotatingFileHandler maxBytes =",
|
||||
getattr(h, "maxBytes", None),
|
||||
"backupCount =",
|
||||
getattr(h, "backupCount", None),
|
||||
)
|
||||
if isinstance(h, lh.TimedRotatingFileHandler):
|
||||
print(
|
||||
" TimedRotating when =",
|
||||
getattr(h, "when", None),
|
||||
"interval =",
|
||||
getattr(h, "interval", None),
|
||||
"backupCount =",
|
||||
getattr(h, "backupCount", None),
|
||||
)
|
||||
@@ -1,14 +0,0 @@
|
||||
from douyin.core.douyin_fudai import fudai_analyse
|
||||
from path_config import get_like_template_path, get_fav_template_path
|
||||
|
||||
a = fudai_analyse()
|
||||
print("default threshold", a.yanghao_icon_match_threshold)
|
||||
like_roi = "pic/roi_test_like_20260104000913_1767456556.png"
|
||||
fav_roi = "pic/roi_test_fav_20260104000916_1767456559.png"
|
||||
like_tpl = get_like_template_path()
|
||||
fav_tpl = get_fav_template_path()
|
||||
print("Like match (default):", a._match_icon_template(like_roi, like_tpl))
|
||||
print("Fav match (default):", a._match_icon_template(fav_roi, fav_tpl))
|
||||
a.yanghao_icon_match_threshold = 0.5
|
||||
print("Like match (thr=0.5):", a._match_icon_template(like_roi, like_tpl))
|
||||
print("Fav match (thr=0.5):", a._match_icon_template(fav_roi, fav_tpl))
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user