362e089be0
Der Nutzer hat recht: Der Ordner war voller Entwicklungs-Muell. Jetzt ist sauber getrennt: ROOT (was der Nutzer sieht und braucht): - run.py = das Programm - hms_app/ = der Anwendungscode - HMS MediaEngine.app = macOS Doppelklick-Starter - HMS-Start.vbs = Windows Doppelklick-Starter - HMS-Install.vbs = Windows Erst-Installation - HMS-Mac-Install.command = macOS Homebrew-Installation - HMS-Portable-Install.command = macOS Portable-Installation (16GB-Fix) - installer_gui.py = grafischer Installer - launcher.pyw + launcher_core.py = interne Start-Logik - LIESMICH.txt = 10-Zeilen-Kurzanleitung - .gitignore _entwicklung/ (alles andere, NICHT benoetigt): - packages/ apps/ native/ plugins/ tools/ schemas/ tests/ docs/ build/ fixture_profiles/ - PLAN.md STATUS.md ERRORS.md TEST_REPORT.md CHANGELOG.md README.md - pyproject.toml uv.lock setup_*.sh/ps1 make_mac_app.py Diese Trennung gilt ab sofort fuer alle Commits. Der Nutzer kann _entwicklung/ loeschen wenn er Platz braucht - die App laeuft ohne. Verifiziert: App startet nach Aufraeumen unveraendert (Health 200).
50 lines
1.4 KiB
Python
50 lines
1.4 KiB
Python
"""Stabile Parameterpfade (PLAN.md §10.2).
|
|
|
|
Pfade werden niemals aus sichtbaren Namen gebildet; alle Teile sind UUIDs
|
|
oder feste Schlüsselwörter.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import uuid
|
|
|
|
_ALLOWED_ROOTS = {"composition", "output", "cluster", "master"}
|
|
|
|
|
|
def _is_uuid(value: str) -> bool:
|
|
try:
|
|
uuid.UUID(value)
|
|
return True
|
|
except (ValueError, AttributeError):
|
|
return False
|
|
|
|
|
|
def validate_parameter_path(path: str) -> bool:
|
|
"""True, wenn der Pfad dem Muster §10.2 entspricht."""
|
|
if not path or path.startswith("/") or "\\" in path or ".." in path:
|
|
return False
|
|
parts = path.split("/")
|
|
root = parts[0]
|
|
if root not in _ALLOWED_ROOTS:
|
|
return False
|
|
if root == "master":
|
|
return len(parts) == 2 and parts[1] != ""
|
|
if root in {"composition", "output"}:
|
|
if len(parts) < 3:
|
|
return False
|
|
if not _is_uuid(parts[1]):
|
|
return False
|
|
return all(p != "" for p in parts[2:])
|
|
# cluster: cluster/group/{uuid}/... oder cluster/node/{uuid}/...
|
|
if len(parts) >= 3 and parts[1] in {"group", "node"} and _is_uuid(parts[2]):
|
|
return all(p != "" for p in parts[3:])
|
|
return False
|
|
|
|
|
|
def layer_opacity_path(composition_id: str, layer_id: str) -> str:
|
|
return f"composition/{composition_id}/layer/{layer_id}/opacity"
|
|
|
|
|
|
def master_intensity_path() -> str:
|
|
return "master/intensity"
|