app
KiCad - the KiCad Bridge
Public Made by Adomby adom
Reference implementation of the KiCad bridge: multi-instance Python server, forward path via kicad-cli, reverse path via in-process plugin. Most complex of the three bundled bridges.
← Commit history
0.9.294: Demo panel callback URL fix: the bridge read its bound port from a second copy of the server module and sent no eventCallbackUrl to ab (panel presses reached the tour only via poll). The port now travels through the environment, so every press is POSTed to the bridge the instant it is clicked. Verified on the test box: a press to the loopback route paused within the beat, muted at once, and resumed on play.
3 files changed
+16−10
BRIDGE_VERSION+1−1@@ -1 +1 @@-0.9.293+0.9.294
bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "kicad", "displayName": "KiCad EDA",- "version": "0.9.293",+ "version": "0.9.294", "description": "Reverse bridge for KiCad \u2014 board/schematic introspection, lint via kicad-cli, plugin install, multi-instance probe, in-process DRC.", "homepage": "https://wiki.adom.inc/adom/adom-bridge", "author": "Adom Inc.",
handlers/demo.py+14−8@@ -652,14 +652,20 @@ _PANEL_SHOWN_ONCE = {"v": False} def _callback_url() -> str | None: """Loopback URL ab POSTs panel presses to (ab 2.1.17). None when the bridge's HTTP server has not bound yet (staged single-step runs from a test harness)."""- try:- import server as _srv- port = (_srv.BOUND or {}).get("port")- host = (_srv.BOUND or {}).get("host") or "127.0.0.1"- if port:- return f"http://{host}:{int(port)}/demo/event"- except Exception: # pylint: disable=broad-except- pass+ import os as _os+ port = _os.environ.get("ADOM_KICAD_BRIDGE_PORT")+ host = _os.environ.get("ADOM_KICAD_BRIDGE_HOST") or "127.0.0.1"+ if not port:+ try:+ import sys as _s+ m = _s.modules.get("__main__")+ b = getattr(m, "BOUND", None) or {}+ port = b.get("port")+ host = b.get("host") or host+ except Exception: # pylint: disable=broad-except+ port = None+ if port:+ return f"http://{host}:{int(port)}/demo/event" return None