MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / _on_export_svg

Method _on_export_svg

SLiCAP/schematic/window.py:837–855  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

835 return str(project.subdir(subdir) / f"{stem}{ext}")
836
837 def _on_export_svg(self):
838 path, _ = QFileDialog.getSaveFileName(
839 self, "Export SVG", self._default_export_path("img", ".svg"),
840 "SVG (*.svg);;All Files (*)"
841 )
842 if not path:
843 return
844 p = Path(path)
845 if p.suffix.lower() != ".svg":
846 p = p.with_suffix(".svg")
847 from .export import export_svg
848 from .canvas import SchematicScene
849 title = self._doc_props.title or (self._current_path.stem if self._current_path else "schematic")
850 try:
851 fresh = SchematicScene()
852 fresh.from_data(self._scene.to_data(), self._library)
853 export_svg(fresh, p, title)
854 except Exception as exc:
855 QMessageBox.critical(self, "Export SVG failed", str(exc))
856
857 def _on_export_pdf(self):
858 path, _ = QFileDialog.getSaveFileName(

Callers

nothing calls this directly

Calls 5

_default_export_pathMethod · 0.95
from_dataMethod · 0.95
SchematicSceneClass · 0.85
export_svgFunction · 0.85
to_dataMethod · 0.80

Tested by

no test coverage detected