第一次提交
This commit is contained in:
19
app-instance/backend/nanobot/config/paths.py
Normal file
19
app-instance/backend/nanobot/config/paths.py
Normal file
@ -0,0 +1,19 @@
|
||||
"""Path helpers shared by config and channel integrations."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from nanobot.config.loader import get_data_dir as _get_data_dir
|
||||
|
||||
|
||||
def get_data_dir() -> Path:
|
||||
"""Return the global nanobot data directory (~/.nanobot)."""
|
||||
return _get_data_dir()
|
||||
|
||||
|
||||
def get_media_dir(channel: str | None = None) -> Path:
|
||||
"""Return the media directory, optionally namespaced by channel."""
|
||||
base = get_data_dir() / "media"
|
||||
if channel:
|
||||
base = base / str(channel)
|
||||
base.mkdir(parents=True, exist_ok=True)
|
||||
return base
|
||||
Reference in New Issue
Block a user