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

Method _save_reference_files

src/bcf/bcf/v2/topic.py:224–233  ·  view source on GitHub ↗
(self, destination_zip: ZipFileInterface)

Source from the content-addressed store, hash-verified

222 destination_zip.writestr(f"{self.topic.guid}/{ref_filename}", self.bim_snippet)
223
224 def _save_reference_files(self, destination_zip: ZipFileInterface) -> None:
225 if not self.header:
226 return
227 for ref in self.header.file:
228 if ref.is_external or not ref.reference:
229 continue
230 real_path = self._topic_dir
231 for path_part in ref.reference.split("/"):
232 real_path = real_path.parent if path_part == ".." else real_path.joinpath(path_part)
233 destination_zip.writestr(real_path.at, self.reference_files[ref.reference])
234
235 def _save_document_references(self, destination_zip: ZipFileInterface) -> None:
236 if not self.topic:

Callers 1

saveMethod · 0.95

Calls 2

splitMethod · 0.80
writestrMethod · 0.45

Tested by

no test coverage detected