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
@@ -185,7 +185,7 @@ def _ensure_ocr():
|
||||
def analyse_pic_word(picname, change_color=0, pic_path=None):
|
||||
"""文字OCR识别(向后兼容接口)"""
|
||||
# 使用全局复用的 underlying_operations 实例,避免每次调用都初始化 OCR(耗时)
|
||||
from Underlying_Operations import underlying_operations
|
||||
from douyin.core.underlying_operations import underlying_operations
|
||||
global _UNDERLYING_OPS_SINGLETON # type: ignore[name-defined]
|
||||
try:
|
||||
_UNDERLYING_OPS_SINGLETON # type: ignore[name-defined]
|
||||
@@ -197,7 +197,7 @@ def analyse_pic_word(picname, change_color=0, pic_path=None):
|
||||
def analyse_pic_digits(picname, change_color=1, pic_path=None):
|
||||
"""数字OCR识别(向后兼容接口)"""
|
||||
# 使用全局复用的 underlying_operations 实例,避免每次调用都初始化 OCR(耗时)
|
||||
from Underlying_Operations import underlying_operations
|
||||
from douyin.core.underlying_operations import underlying_operations
|
||||
global _UNDERLYING_OPS_SINGLETON # type: ignore[name-defined]
|
||||
try:
|
||||
_UNDERLYING_OPS_SINGLETON # type: ignore[name-defined]
|
||||
@@ -209,7 +209,7 @@ def analyse_pic_digits(picname, change_color=1, pic_path=None):
|
||||
def extract_ocr_content(content=[], return_confidence=False):
|
||||
"""提取OCR内容(向后兼容接口)"""
|
||||
# 使用全局复用的 underlying_operations 实例
|
||||
from Underlying_Operations import underlying_operations
|
||||
from douyin.core.underlying_operations import underlying_operations
|
||||
global _UNDERLYING_OPS_SINGLETON # type: ignore[name-defined]
|
||||
try:
|
||||
_UNDERLYING_OPS_SINGLETON # type: ignore[name-defined]
|
||||
|
||||
Reference in new issue
Block a user