Save the topic to a BCF zip file. Args: bcf_zip: The BCF zip file to save to.
(self, destination_zip: ZipFileInterface)
| 185 | return obj |
| 186 | |
| 187 | def save(self, destination_zip: ZipFileInterface) -> None: |
| 188 | """ |
| 189 | Save the topic to a BCF zip file. |
| 190 | |
| 191 | Args: |
| 192 | bcf_zip: The BCF zip file to save to. |
| 193 | """ |
| 194 | topic_dir = self.guid |
| 195 | # simulating directory creation (ZipFile in python < 3.11 doesn't have mkdir) |
| 196 | destination_zip.writestr(f"{topic_dir}/", "") |
| 197 | self._save_xml(destination_zip, self._markup, "markup.bcf") |
| 198 | self._save_viewpoints(destination_zip, topic_dir) |
| 199 | self._save_bim_snippet(destination_zip) |
| 200 | self._save_reference_files(destination_zip) |
| 201 | self._save_document_references(destination_zip) |
| 202 | |
| 203 | def _save_viewpoints(self, destination_zip: ZipFileInterface, topic_dir: str) -> None: |
| 204 | if not self.markup or not (viewpoints := self.markup.viewpoints): |
no test coverage detected