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

Method write

src/docx/opc/pkgwriter.py:31–38  ·  view source on GitHub ↗

Write a physical package (.pptx file) to `pkg_file` containing `pkg_rels` and `parts` and a content types stream based on the content types of the parts.

(pkg_file, pkg_rels, parts)

Source from the content-addressed store, hash-verified

29
30 @staticmethod
31 def write(pkg_file, pkg_rels, parts):
32 """Write a physical package (.pptx file) to `pkg_file` containing `pkg_rels` and
33 `parts` and a content types stream based on the content types of the parts."""
34 phys_writer = PhysPkgWriter(pkg_file)
35 PackageWriter._write_content_types_stream(phys_writer, parts)
36 PackageWriter._write_pkg_rels(phys_writer, pkg_rels)
37 PackageWriter._write_parts(phys_writer, parts)
38 phys_writer.close()
39
40 @staticmethod
41 def _write_content_types_stream(phys_writer, parts):

Callers 3

_write_partsMethod · 0.45
_write_pkg_relsMethod · 0.45

Calls 5

PhysPkgWriterClass · 0.90
_write_pkg_relsMethod · 0.80
_write_partsMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected