#!/usr/bin/env python3 """Compile shows/simple.show.json into shows/simple.qxw.""" from __future__ import annotations import json import sys from pathlib import Path ROOT = Path(__file__).resolve().parents[2] if str(ROOT) not in sys.path: sys.path.insert(0, str(ROOT)) from showfile.tools import write_show def main() -> None: spec = json.loads((ROOT / "shows" / "simple.show.json").read_text(encoding="utf-8")) result = write_show(spec, "shows/simple.qxw", root=ROOT) if not result["ok"]: raise SystemExit(json.dumps(result, indent=2)) print(f"Wrote {result['path']} ({len(result['widgets'])} widgets)") if __name__ == "__main__": main()