2023-03-14 01:27:22 +00:00
|
|
|
"""目录常量"""
|
2024-03-16 01:44:15 +00:00
|
|
|
|
2023-03-14 01:27:22 +00:00
|
|
|
from pathlib import Path
|
|
|
|
|
2023-11-04 05:42:15 +00:00
|
|
|
__all__ = ["PROJECT_ROOT", "CORE_DIR", "PLUGIN_DIR", "RESOURCE_DIR", "CACHE_DIR", "METADATA_DIR", "DATA_DIR"]
|
2023-03-14 01:27:22 +00:00
|
|
|
|
|
|
|
# 项目根目录
|
|
|
|
PROJECT_ROOT = Path(__file__).joinpath("../../..").resolve()
|
|
|
|
# Core 目录
|
|
|
|
CORE_DIR = PROJECT_ROOT / "core"
|
|
|
|
# 插件目录
|
|
|
|
PLUGIN_DIR = PROJECT_ROOT / "plugins"
|
|
|
|
# 资源目录
|
|
|
|
RESOURCE_DIR = PROJECT_ROOT / "resources"
|
|
|
|
# cache 目录
|
|
|
|
CACHE_DIR = PROJECT_ROOT / "cache"
|
2023-11-04 05:42:15 +00:00
|
|
|
# metadata 目录
|
|
|
|
METADATA_DIR = PROJECT_ROOT / "metadata" / "data"
|
|
|
|
# data 目录
|
|
|
|
DATA_DIR = PROJECT_ROOT / "data"
|
2023-03-14 01:27:22 +00:00
|
|
|
|
|
|
|
if not CACHE_DIR.exists():
|
|
|
|
CACHE_DIR.mkdir(exist_ok=True, parents=True)
|