fix: DSA path auto-detect — check server path /home/hmo/daily-stock-analysis first
This commit is contained in:
Binary file not shown.
Binary file not shown.
+13
-3
@@ -26,10 +26,20 @@ from pathlib import Path
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# DSA 源码路径
|
# DSA 源码路径(按优先级尝试)
|
||||||
_DSA_BASE = Path(__file__).resolve().parent.parent / "daily-stock-analysis" / "ZhuLinsen-daily_stock_analysis-a448886"
|
_DSA_CANDIDATES = [
|
||||||
|
"/home/hmo/daily-stock-analysis",
|
||||||
|
str(Path(__file__).resolve().parent.parent / "daily-stock-analysis" / "ZhuLinsen-daily_stock_analysis-a448886"),
|
||||||
|
]
|
||||||
|
|
||||||
_HAS_DSA = _DSA_BASE.is_dir() and (_DSA_BASE / "data_provider" / "base.py").exists()
|
_DSA_BASE = None
|
||||||
|
for _c in _DSA_CANDIDATES:
|
||||||
|
_p = Path(_c)
|
||||||
|
if _p.is_dir() and (_p / "data_provider" / "base.py").exists():
|
||||||
|
_DSA_BASE = _p
|
||||||
|
break
|
||||||
|
|
||||||
|
_HAS_DSA = _DSA_BASE is not None
|
||||||
|
|
||||||
|
|
||||||
def enrich_analysis_context(region: str = "cn") -> str:
|
def enrich_analysis_context(region: str = "cn") -> str:
|
||||||
|
|||||||
+14
-6
@@ -36,14 +36,22 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
# ── 路径配置 ─────────────────────────────────────────────────────────
|
# ── 路径配置 ─────────────────────────────────────────────────────────
|
||||||
|
|
||||||
# DSA 源码路径(相对于 MoFin 项目)
|
# DSA 源码路径(按优先级尝试)
|
||||||
_DSA_BASE = os.path.normpath(os.path.join(
|
_DSA_CANDIDATES = [
|
||||||
|
"/home/hmo/daily-stock-analysis", # 服务器部署路径
|
||||||
|
os.path.normpath(os.path.join( # 本地开发路径
|
||||||
os.path.dirname(os.path.abspath(__file__)),
|
os.path.dirname(os.path.abspath(__file__)),
|
||||||
"..", "daily-stock-analysis",
|
"..", "daily-stock-analysis", "ZhuLinsen-daily_stock_analysis-a448886"
|
||||||
"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 ───────────────────────────────────────────────────
|
# ── MoDataProvider ───────────────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user