MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / _smart_save_xml

Method _smart_save_xml

src/bcf/bcf/v2/bcfxml.py:218–222  ·  view source on GitHub ↗
(self, destination_zip: ZipFileInterface, item: Any, target: str)

Source from the content-addressed store, hash-verified

216 self._save_xml(destination_zip, "bcf.version", self.version)
217
218 def _smart_save_xml(self, destination_zip: ZipFileInterface, item: Any, target: str) -> None:
219 if item:
220 self._save_xml(destination_zip, target, item)
221 elif self._zip_file and zipfile.Path(self._zip_file, target).exists():
222 destination_zip.writestr(target, self._zip_file.read(target))
223
224 def _save_xml(self, destination_zip: ZipFileInterface, inner_file: str, xml_obj: Any) -> None:
225 destination_zip.writestr(inner_file, self._xml_handler.serialize(xml_obj))

Callers 1

_save_projectMethod · 0.95

Calls 3

_save_xmlMethod · 0.95
writestrMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected