fix: entry-point scripts douyin.* import 失败 — sys.path 在 import 之后才设置
bin/run_cli.py 的 _BASE_DIR+sys.path.insert 原在 logging import 之后, 导致 No module named 'douyin' 警告。tools/ 下 5 个脚本完全缺失 sys.path 设置,auto_connect_wifi_adb.py 层级算错只跳到 tools/ 而非项目根。
This commit is contained in:
1 parent
f750969df3
commit
2fab3f238e
7 files changed
+40
-12
No files matched your search
@@ -1,3 +1,10 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
_PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
if _PROJECT_ROOT not in sys.path:
|
||||
sys.path.insert(0, _PROJECT_ROOT)
|
||||
|
||||
from douyin.core.douyin_fudai import fudai_analyse
|
||||
from douyin.handlers import douyin_swipe_ops
|
||||
|
||||
|
||||
Reference in new issue
Block a user