a25593a9c6
Group all 69 projects into category subfolders under src/ and tests/ so the Rider Solution Explorer mirrors the module structure. Folders: Core, Server, Drivers (with a nested Driver CLIs subfolder), Client, Tooling. - Move every project folder on disk with git mv (history preserved as renames). - Recompute relative paths in 57 .csproj files: cross-category ProjectReferences, the lib/ HintPath+None refs in Driver.Historian.Wonderware, and the external mxaccessgw refs in Driver.Galaxy and its test project. - Rebuild ZB.MOM.WW.OtOpcUa.slnx with nested solution folders. - Re-prefix project paths in functional scripts (e2e, compliance, smoke SQL, integration, install). Build green (0 errors); unit tests pass. Docs left for a separate pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
from __future__ import annotations
|
|
|
|
import json
|
|
from pathlib import Path
|
|
from typing import Any
|
|
|
|
|
|
PROFILE_DIR = Path(__file__).resolve().parent / "builtin_profiles"
|
|
|
|
PROFILE_ALIASES = {
|
|
"ZeroI_D": "fwlib0iD64",
|
|
"ZeroI_F": "fwlib0iD64",
|
|
"ZeroI_MF": "fwlib0iD64",
|
|
"ZeroI_TF": "fwlib0iD64",
|
|
"Sixteen_i": "FWLIB64",
|
|
"Thirty_i": "fwlib30i64",
|
|
"ThirtyOne_i": "fwlib30i64",
|
|
"ThirtyTwo_i": "fwlib30i64",
|
|
"PowerMotion_i": "fwlib0DN64",
|
|
}
|
|
|
|
|
|
def list_profiles() -> list[str]:
|
|
return sorted(path.stem for path in PROFILE_DIR.glob("*.json"))
|
|
|
|
|
|
def resolve_profile_name(profile_name: str) -> str:
|
|
return PROFILE_ALIASES.get(profile_name, profile_name)
|
|
|
|
|
|
def load_profile(profile_name: str) -> dict[str, Any]:
|
|
profile_name = resolve_profile_name(profile_name)
|
|
candidates = [
|
|
PROFILE_DIR / f"{profile_name}.json",
|
|
PROFILE_DIR / f"{Path(profile_name).stem}.json",
|
|
]
|
|
for candidate in candidates:
|
|
if candidate.exists():
|
|
return json.loads(candidate.read_text(encoding="utf-8"))
|
|
available = ", ".join(list_profiles())
|
|
raise FileNotFoundError(f"Unknown profile '{profile_name}'. Available profiles: {available}")
|