docs/完整技术文档: 可执行 import 示例改为新路径
8 处 from Underlying_Operations / from path_config / python -c "..." 示例改为 douyin.core.underlying_operations / douyin.core.path_config, 确保读者复制粘贴能跑通。 文档头部"路径迁移说明"表里左侧"旧"列保留旧路径作为对照;正文叙述性 提及(如 "见 Underlying_Operations.get_screenshot() 实现")暂保留, 读者依靠头部表对照即可。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
af4fc9168b
commit
b6d2836e84
1 file changed
+7
-7
+7
-7
@@ -381,7 +381,7 @@ Remove-Item pic\screenshot.png.tmp -Force -ErrorAction SilentlyContinue
|
||||
- OCR 未初始化或识别异常:
|
||||
|
||||
```python
|
||||
from Underlying_Operations import underlying_operations
|
||||
from douyin.core.underlying_operations import underlying_operations
|
||||
op = underlying_operations()
|
||||
op._ensure_ocr()
|
||||
print(op.analyse_pic_word('pic/screenshot.png'))
|
||||
@@ -445,7 +445,7 @@ python -m py_compile $(git ls-files "**/*.py")
|
||||
```bash
|
||||
python -m py_compile $(git ls-files "**/*.py") || exit 1
|
||||
python - <<'PY'
|
||||
from path_config import get_reservations_path
|
||||
from douyin.core.path_config import get_reservations_path
|
||||
import os
|
||||
print('reservations path', get_reservations_path())
|
||||
assert os.path.isdir(os.path.dirname(get_reservations_path()))
|
||||
@@ -466,7 +466,7 @@ PY
|
||||
- 可调用的“程序式”API(Python)示例:
|
||||
|
||||
```python
|
||||
from Underlying_Operations import underlying_operations
|
||||
from douyin.core.underlying_operations import underlying_operations
|
||||
op = underlying_operations()
|
||||
# 获取当前截图路径
|
||||
img = op.get_screenshot('<ADB_ID>')
|
||||
@@ -605,7 +605,7 @@ text = op.analyse_pic_word(img)
|
||||
1. 验证截图是否可用:
|
||||
|
||||
```powershell
|
||||
python -c "from Underlying_Operations import underlying_operations; op=underlying_operations(); print(op.get_screenshot('<DEVICE_ID>'))"
|
||||
python -c "from douyin.core.underlying_operations import underlying_operations; op=underlying_operations(); print(op.get_screenshot('<DEVICE_ID>'))"
|
||||
```
|
||||
|
||||
2. 快速语法检查(仓库级):
|
||||
@@ -647,7 +647,7 @@ python run_cli.py --device-id <ADB_ID> --wait-minutes 1
|
||||
```bash
|
||||
python -m py_compile $(git ls-files "**/*.py") || exit 1
|
||||
python - <<'PY'
|
||||
from path_config import get_reservations_path
|
||||
from douyin.core.path_config import get_reservations_path
|
||||
import os
|
||||
print('reservations path', get_reservations_path())
|
||||
assert os.path.isdir(os.path.dirname(get_reservations_path()))
|
||||
@@ -1879,7 +1879,7 @@ def attend_choujiang(analyser) -> bool:
|
||||
```python
|
||||
def load_reservations_from_state(analyser) -> list:
|
||||
import json
|
||||
import path_config
|
||||
from douyin.core import path_config
|
||||
|
||||
reservations_path = path_config.get_reservations_path()
|
||||
if not os.path.exists(reservations_path):
|
||||
@@ -3959,7 +3959,7 @@ logger.error(
|
||||
```python
|
||||
# run_cli.py
|
||||
from douyin.core.douyin_fudai import fudai_analyse
|
||||
from Underlying_Operations import underlying_operations
|
||||
from douyin.core.underlying_operations import underlying_operations
|
||||
|
||||
# 初始化
|
||||
operation = underlying_operations()
|
||||
|
||||
Reference in new issue
Block a user