Save the documents to the zip file.
(self, bcf_zip: ZipFileInterface)
| 51 | return cls(definition, documents=documents) |
| 52 | |
| 53 | def save(self, bcf_zip: ZipFileInterface) -> None: |
| 54 | """Save the documents to the zip file.""" |
| 55 | bcf_zip.writestr("documents.xml", self._xml_handler.serialize(self.definition)) |
| 56 | if documents := self.definition.documents: |
| 57 | for doc in documents.document: |
| 58 | if doc.filename in self.documents: |
| 59 | bcf_zip.writestr( |
| 60 | f"documents/{doc.guid}", |
| 61 | self.documents[doc.filename], |
| 62 | ) |