Save the topic to a BCF zip file. Args: bcf_zip: The BCF zip file to save to.
(self, destination_zip: ZipFileInterface)
| 173 | return obj |
| 174 | |
| 175 | def save(self, destination_zip: ZipFileInterface) -> None: |
| 176 | """ |
| 177 | Save the topic to a BCF zip file. |
| 178 | |
| 179 | Args: |
| 180 | bcf_zip: The BCF zip file to save to. |
| 181 | """ |
| 182 | topic_dir = self.guid |
| 183 | # simulating directory creation (ZipFile in python < 3.11 doesn't have mkdir) |
| 184 | destination_zip.writestr(f"{topic_dir}/", "") |
| 185 | self._save_xml(destination_zip, self._markup, "markup.bcf") |
| 186 | self._save_viewpoints(destination_zip, topic_dir) |
| 187 | self._save_bim_snippet(destination_zip) |
| 188 | self._save_reference_files(destination_zip) |
| 189 | |
| 190 | def _save_viewpoints(self, destination_zip: ZipFileInterface, topic_dir: str) -> None: |
| 191 | if not self.topic.viewpoints or not (viewpoints := self.topic.viewpoints.view_point): |
no test coverage detected