MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / update_symbols

Method update_symbols

SLiCAP/schematic/symbol_library.py:388–401  ·  view source on GitHub ↗

Replace this library's definitions of *names* with those from *other*. Used to refresh a schematic's frozen symbols with the most recent versions from the live symbol library. Returns the names that were actually found in *other* and updated; names absent there are left

(self, other: "SymbolLibrary", names)

Source from the content-addressed store, hash-verified

386 Path(path).write_text(content, encoding="utf-8")
387
388 def update_symbols(self, other: "SymbolLibrary", names) -> list[str]:
389 """Replace this library's definitions of *names* with those from *other*.
390
391 Used to refresh a schematic's frozen symbols with the most recent
392 versions from the live symbol library. Returns the names that were
393 actually found in *other* and updated; names absent there are left
394 untouched (reported back so the caller can warn the user)."""
395 updated: list[str] = []
396 for n in names:
397 sym = other.symbol(n)
398 if sym is not None:
399 self._symbols[n] = sym
400 updated.append(n)
401 return updated
402
403 # ── public API ────────────────────────────────────────────────────────────
404

Callers 1

_on_reload_symbolsMethod · 0.80

Calls 1

symbolMethod · 0.80

Tested by

no test coverage detected