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>
This commit is contained in:
1 parent
e3e399da70
commit
8fe7ff0585
51 files changed
+136
-132
No files matched your search
+4
-4
@@ -17,7 +17,7 @@ project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
if project_root not in sys.path:
|
||||
sys.path.insert(0, project_root)
|
||||
|
||||
import path_config
|
||||
from douyin.core import path_config
|
||||
|
||||
BASE_DIR = path_config.PROJECT_ROOT
|
||||
CONFIG_PATH = path_config.get_config_path()
|
||||
@@ -1359,7 +1359,7 @@ class ProcRunner:
|
||||
# 启动时自动截图
|
||||
if device_id:
|
||||
try:
|
||||
from Underlying_Operations import underlying_operations
|
||||
from douyin.core.underlying_operations import underlying_operations
|
||||
|
||||
ops = underlying_operations()
|
||||
self._append_log(f"[启动] 自动截图: device={device_id}")
|
||||
@@ -2203,7 +2203,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
body = self._read_json()
|
||||
device_id = str(body.get("device_id") or "").strip()
|
||||
try:
|
||||
from Underlying_Operations import underlying_operations
|
||||
from douyin.core.underlying_operations import underlying_operations
|
||||
|
||||
ops = underlying_operations()
|
||||
result = ops.get_screenshot(device_id, use_service=False)
|
||||
@@ -2249,7 +2249,7 @@ def main() -> int:
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
from version import print_version_banner
|
||||
from douyin.core.version import print_version_banner
|
||||
|
||||
print_version_banner("web_gui")
|
||||
except Exception:
|
||||
|
||||
Reference in new issue
Block a user