MCPcopy Index your code
hub / github.com/python-openxml/python-docx / _write_parts

Method _write_parts

src/docx/opc/pkgwriter.py:48–54  ·  view source on GitHub ↗

Write the blob of each part in `parts` to the package, along with a rels item for its relationships if and only if it has any.

(phys_writer: PhysPkgWriter, parts: Iterable[Part])

Source from the content-addressed store, hash-verified

46
47 @staticmethod
48 def _write_parts(phys_writer: PhysPkgWriter, parts: Iterable[Part]):
49 """Write the blob of each part in `parts` to the package, along with a rels item
50 for its relationships if and only if it has any."""
51 for part in parts:
52 phys_writer.write(part.partname, part.blob)
53 if len(part.rels):
54 phys_writer.write(part.partname.rels_uri, part.rels.xml)
55
56 @staticmethod
57 def _write_pkg_rels(phys_writer, pkg_rels):

Callers 3

writeMethod · 0.80

Calls 1

writeMethod · 0.45

Tested by 2