| 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: |