This commit is contained in:
Team3
2026-06-06 17:40:06 +02:00
parent c84fbbb484
commit b2486a73a1
13 changed files with 203 additions and 342 deletions

View File

@@ -1,30 +1,35 @@
import re
from pathlib import Path
from config import STORAGE_DIR, PROJECTS_DIR
THEMEN_DIR = STORAGE_DIR / "themen"
def _safe(name: str) -> str:
return name.replace("/", "_").replace("\x00", "")
def guide_content_path(topic: str, format_name: str) -> Path:
return STORAGE_DIR / "guides" / f"{_safe(topic)} - {format_name}.json"
def topic_dir(topic: str) -> Path:
return THEMEN_DIR / _safe(topic)
def arbeit_dir(topic: str) -> Path:
return topic_dir(topic) / "arbeit"
def bausteine_path(topic: str) -> Path:
return STORAGE_DIR / "bausteine" / f"{_safe(topic)}.md"
return topic_dir(topic) / "bausteine.md"
def guide_content_path(topic: str, format_name: str) -> Path:
return topic_dir(topic) / "guides" / f"{format_name}.json"
def bausteine_topics() -> list[str]:
"""Themen, für die eine finale Baustein-Datei existiert (ohne Zwischendateien)."""
bdir = STORAGE_DIR / "bausteine"
if not bdir.is_dir():
"""Themen, für die ein Themen-Ordner existiert."""
if not THEMEN_DIR.is_dir():
return []
return [
p.stem for p in bdir.glob("*.md")
if not re.search(r"\.(recherche-\d+|auswahl(-\d+|-check)?|einordnung-\d+|final-check|sortierung)$", p.stem)
]
return [d.name for d in THEMEN_DIR.iterdir() if d.is_dir()]
def project_dir(name: str) -> Path: