24 lines
592 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from __future__ import annotations
from functools import lru_cache
from pathlib import Path
@lru_cache(maxsize=1)
def get_root_path() -> Path:
"""返回项目根目录:从 utils/path.py 回退到仓库根 (../../..)。"""
return Path(__file__).resolve().parents[4]
@lru_cache(maxsize=1)
def get_apps_path() -> Path:
"""返回 apps 目录路径。"""
return get_root_path() / "apps"
@lru_cache(maxsize=1)
def get_jingrow_root() -> Path:
"""返回 jingrow 模块根目录路径apps/jingrow/jingrow"""
return get_root_path() / "apps" / "jingrow" / "jingrow"