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

Method _save_to

SLiCAP/schematic/window.py:760–779  ·  view source on GitHub ↗
(self, path: Path)

Source from the content-addressed store, hash-verified

758 )
759
760 def _save_to(self, path: Path):
761 self._doc_props.last_modified = _date.today().isoformat()
762 data = self._scene.to_data()
763 data.properties = self._doc_props
764 try:
765 data.save(path)
766 self._current_path = path
767 project.set_current(path) # migrates session-temp cache → <name>.cache
768 import SLiCAP.schematic.config as _config
769 _config.write(project.ini_path()) # persist current style → <name>.ini
770 used = {c.symbol_name for c in data.components}
771 if used: # freeze the symbols this schematic uses
772 self._library.write_bundle(used, project.symbols_path())
773 self._dirty = False
774 self.setWindowTitle(f"SLiCAP — {path.name}")
775 except Exception as exc:
776 QMessageBox.critical(self, "Save failed", str(exc))
777 return
778 self._current_path = path
779 self.setWindowTitle(f"SLiCAP — {path.name}")
780
781 def _on_doc_properties(self):
782 from .document_properties_dialog import DocumentPropertiesDialog

Callers 4

_on_saveMethod · 0.95
_on_save_asMethod · 0.95
_save_subcircuitMethod · 0.95
closeEventMethod · 0.95

Calls 4

to_dataMethod · 0.80
writeMethod · 0.80
write_bundleMethod · 0.80
saveMethod · 0.45

Tested by

no test coverage detected