fix: DSA path auto-detect — check server path /home/hmo/daily-stock-analysis first
This commit is contained in:
+13
-3
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user