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

Method _ensure_library_include

SLiCAP/schematic/window.py:348–357  ·  view source on GitHub ↗

Add a .lib include for lib_path unless one is already on the canvas.

(self, lib_path: str)

Source from the content-addressed store, hash-verified

346 self._scene.start_placement(defn.name, svg)
347
348 def _ensure_library_include(self, lib_path: str):
349 """Add a .lib include for lib_path unless one is already on the canvas."""
350 from .library_item import LibraryItem
351 target = str(Path(lib_path).resolve())
352 for item in self._scene.items():
353 if isinstance(item, LibraryItem) and \
354 str(Path(item.file_path).resolve()) == target:
355 return
356 pos = self._view.mapToScene(20, 20)
357 self._scene.addItem(LibraryItem(str(lib_path), pos))
358
359 def _on_place_image(self):
360 from .image_dialog import ImageDialog

Callers 1

_on_place_subcircuitMethod · 0.95

Calls 1

LibraryItemClass · 0.85

Tested by

no test coverage detected