Load a .slicap_sch file and return (SchematicScene, SchematicData).
(input_path: Path)
| 38 | # ── shared scene loader ─────────────────────────────────────────────────────── |
| 39 | |
| 40 | def _load_scene(input_path: Path): |
| 41 | """Load a .slicap_sch file and return (SchematicScene, SchematicData).""" |
| 42 | from .schematic_data import SchematicData |
| 43 | from .symbol_library import SymbolLibrary |
| 44 | from .canvas import SchematicScene |
| 45 | from . import project |
| 46 | |
| 47 | project.set_current(input_path) # LaTeX cache → <name>.cache, not a temp dir |
| 48 | import SLiCAP.schematic.config as _config |
| 49 | _config.load(project.ini_path()) # apply schematic's saved style settings |
| 50 | data = SchematicData.load(input_path) |
| 51 | library = SymbolLibrary(_SYMBOLS_SVG) |
| 52 | library.add_bundle(project.symbols_path()) # this schematic's frozen symbols |
| 53 | library.inject_into_component_item() |
| 54 | scene = SchematicScene() |
| 55 | scene.from_data(data, library) |
| 56 | return scene, data |
| 57 | |
| 58 | |
| 59 | # ── subcommands ─────────────────────────────────────────────────────────────── |
no test coverage detected