fix: DSA path auto-detect — check server path /home/hmo/daily-stock-analysis first

This commit is contained in:
hmo
2026-06-29 23:47:59 +08:00
parent 6abc2e45b0
commit 89153832b4
4 changed files with 28 additions and 10 deletions
+13 -3
View File
@@ -26,10 +26,20 @@ from pathlib import Path
logger = logging.getLogger(__name__)
# DSA 源码路径
_DSA_BASE = Path(__file__).resolve().parent.parent / "daily-stock-analysis" / "ZhuLinsen-daily_stock_analysis-a448886"
# DSA 源码路径(按优先级尝试)
_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: