fix: DSA path auto-detect — check server path /home/hmo/daily-stock-analysis first
This commit is contained in:
+15
-7
@@ -36,14 +36,22 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
# ── 路径配置 ─────────────────────────────────────────────────────────
|
||||
|
||||
# DSA 源码路径(相对于 MoFin 项目)
|
||||
_DSA_BASE = os.path.normpath(os.path.join(
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
"..", "daily-stock-analysis",
|
||||
"ZhuLinsen-daily_stock_analysis-a448886"
|
||||
))
|
||||
# DSA 源码路径(按优先级尝试)
|
||||
_DSA_CANDIDATES = [
|
||||
"/home/hmo/daily-stock-analysis", # 服务器部署路径
|
||||
os.path.normpath(os.path.join( # 本地开发路径
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
"..", "daily-stock-analysis", "ZhuLinsen-daily_stock_analysis-a448886"
|
||||
)),
|
||||
]
|
||||
|
||||
_HAS_DSA = os.path.isdir(_DSA_BASE)
|
||||
_DSA_BASE = None
|
||||
for _c in _DSA_CANDIDATES:
|
||||
if os.path.isdir(_c) and os.path.isfile(os.path.join(_c, "data_provider", "base.py")):
|
||||
_DSA_BASE = _c
|
||||
break
|
||||
|
||||
_HAS_DSA = _DSA_BASE is not None
|
||||
|
||||
|
||||
# ── MoDataProvider ───────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user