← Commit history

0.9.343: notes, list_footprints test

John Lauer ·c82dfc9238 ·1mo ago ·parent f7430ff
2 files changed +36
RELEASE_NOTES.md+12
@@ -10,6 +10,18 @@ unnamed. These entries were reconstructed after the fact from the work they contain, which is exactly the situation the mandatory-notes gate now prevents. Treat them as accurate but secondhand. +## 0.9.343  (2026-09-07 18:29 UTC)++Footprint loads with two pcbnew processes; list_footprints reads the fp-lib-table (#81)++## 0.9.343 (2026-09-07): footprint loads with two pcbnew processes (#81)++- The Library Tree toggle behind every background footprint load asked "the" pcbnew plugin and, with+  two pcbnew processes alive, got a stray PCB Editor that has no Footprint Editor frame; the tree+  stayed hidden and the load typed into nothing. It now asks the pcbnew that owns the Footprint Editor.+- `kicad_list_footprints` lists every library in the fp-lib-table with URIs expanded like KiCad does+  (stock Resistor_SMD and friends included), not only Documents/KiCad/<ver>/footprints.+ ## 0.9.342  (2026-09-07 18:13 UTC)  First-run wizard deadlock: time-boxed dialog clicks and bounded sweeps (#83)
tests/test_list_footprints.pyadded+24
@@ -0,0 +1,24 @@+import sys, tempfile, unittest+from pathlib import Path+from unittest.mock import patch+sys.path.insert(0, str(Path(__file__).resolve().parents[1]))+import adom_library+from handlers import install_footprint++class ListFootprints(unittest.TestCase):+    def test_stock_library_from_table(self):+        with tempfile.TemporaryDirectory() as d:+            base = Path(d) / "kicad"; share = base / "share" / "kicad" / "footprints" / "Resistor_SMD.pretty"; share.mkdir(parents=True)+            (share / "R_0603_1608Metric.kicad_mod").write_text("(footprint)")+            cfg = Path(d) / "cfg"; cfg.mkdir(); user = Path(d) / "user"; (user / "footprints" / "Adom.pretty").mkdir(parents=True)+            (user / "footprints" / "Adom.pretty" / "X.kicad_mod").write_text("(footprint)")+            (cfg / "fp-lib-table").write_text('(fp_lib_table\n  (version 7)\n  (lib (name "Resistor_SMD")(type "KiCad")(uri "${KICAD10_FOOTPRINT_DIR}/Resistor_SMD.pretty")(options "")(descr ""))\n)\n')+            info = {"version": "10.0", "base_dir": str(base), "user_dir": str(user), "config_dir": str(cfg)}+            with patch.object(adom_library, "_kicad_env_overrides", return_value={}):+                r = install_footprint.handle_list_footprints(info, {"library": "Resistor_SMD"})+                self.assertEqual(r["libraries"]["Resistor_SMD"]["footprints"], ["R_0603_1608Metric"])+                r = install_footprint.handle_list_footprints(info, {})+                self.assertEqual(sorted(r["libraries"]), ["Adom", "Resistor_SMD"])++if __name__ == "__main__":+    unittest.main()