将 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>
20 lines
598 B
Python
20 lines
598 B
Python
from douyin.core.underlying_operations import underlying_operations
|
|
import time
|
|
|
|
op = underlying_operations()
|
|
# try to trigger several screenshots
|
|
for i in range(8):
|
|
print(f"Triggering screenshot #{i+1}")
|
|
ok = op.get_screenshot(device_id="DUMMY_DEVICE", path="pic", use_service=False)
|
|
print("result:", ok)
|
|
time.sleep(0.6)
|
|
|
|
print("\n--- Log snippet ---")
|
|
try:
|
|
with open("logs/screenshot_calls.log", "r", encoding="utf-8") as f:
|
|
lines = f.read().splitlines()
|
|
for ln in lines[-120:]:
|
|
print(ln)
|
|
except Exception as e:
|
|
print("Could not read log:", e)
|