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)
| 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 |
no test coverage detected