remove gitignore

This commit is contained in:
Ubuntu
2025-09-11 13:29:12 +00:00
parent 45bcf4274f
commit 9fdfed9655
11605 changed files with 6174940 additions and 127 deletions

View File

@@ -0,0 +1,31 @@
from pathlib import Path
import sys, os
def bootstrap_paths():
"""
'AlgoriAgent'(位于 repo_root/AlgoriAgent可被 import
并提供 STUDENT_WORKSPACE_ROOT 的默认值repo_root/study
适配当前工厂位置repo_root/Html/apps/__init__.py
"""
here = Path(__file__).resolve()
# repo_root = .../Html/apps/../../ => parents[2]
repo_root = here.parents[2]
# 兜底:如果目录结构变化,尝试向上搜索包含 AlgoriAgent 的目录作为 repo_root
if not (repo_root / "AlgoriAgent").exists():
for p in here.parents:
if (p / "AlgoriAgent").is_dir():
repo_root = p
break
# 确保仓库根在 sys.path这样 'AlgoriAgent' 顶层包可被发现)
repo_root_str = str(repo_root)
if repo_root_str not in sys.path:
sys.path.insert(0, repo_root_str)
# 可选:如果你还有其它顶层包,也可在此处继续插入
# 默认学习工作区目录(也可放到 config.ini / 环境变量覆盖)
os.environ.setdefault("STUDENT_WORKSPACE_ROOT", str(repo_root / "study"))
return repo_root # 方便调试/日志