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
kicad_detect.py+5−4@@ -12,6 +12,7 @@ explicitly request an older version via the `kicadVersion` arg on commands. import os import re import subprocess+from proc import run as _safe_run import sys from pathlib import Path @@ -275,7 +276,7 @@ def _probe_python_version(python_exe: Path) -> str | None: if not python_exe.exists(): return None try:- result = subprocess.run(+ result = _safe_run( [str(python_exe), "--version"], capture_output=True, text=True, timeout=5, )@@ -491,7 +492,7 @@ def _probe_ipc_api(python_exe: Path) -> dict: " json.dump({'available': False, 'scope': []}, sys.stdout)\n" ) try:- result = subprocess.run(+ result = _safe_run( [str(python_exe), "-c", probe], capture_output=True, text=True, timeout=5, )@@ -574,7 +575,7 @@ def _win_detect_all() -> list[dict]: if not cli.exists(): return try:- result = subprocess.run([str(cli), "--version"], capture_output=True, text=True, timeout=5)+ result = _safe_run([str(cli), "--version"], capture_output=True, text=True, timeout=5) m = re.search(r"(\d+\.\d+(?:\.\d+)?)", result.stdout + result.stderr) if not m: return@@ -629,7 +630,7 @@ def _mac_app_version(app_path: Path) -> str | None: if not plist.exists(): return None try:- result = subprocess.run(+ result = _safe_run( ["/usr/libexec/PlistBuddy", "-c", "Print :CFBundleShortVersionString", str(plist)], capture_output=True, text=True, timeout=5, )