MCPcopy Create free account
hub / github.com/scanny/python-pptx / factory

Method factory

src/pptx/opc/serialized.py:202–208  ·  view source on GitHub ↗

Return |_PhysPkgWriter| subtype instance appropriage for `pkg_file`. Currently the only subtype is `_ZipPkgWriter`, but a `_DirPkgWriter` could be implemented or even a `_StreamPkgWriter`.

(cls, pkg_file: str | IO[bytes])

Source from the content-addressed store, hash-verified

200
201 @classmethod
202 def factory(cls, pkg_file: str | IO[bytes]) -> _ZipPkgWriter:
203 """Return |_PhysPkgWriter| subtype instance appropriage for `pkg_file`.
204
205 Currently the only subtype is `_ZipPkgWriter`, but a `_DirPkgWriter` could be implemented
206 or even a `_StreamPkgWriter`.
207 """
208 return _ZipPkgWriter(pkg_file)
209
210 def write(self, pack_uri: PackURI, blob: bytes) -> None:
211 """Write `blob` to package with membername corresponding to `pack_uri`."""

Callers

nothing calls this directly

Calls 1

_ZipPkgWriterClass · 0.85

Tested by

no test coverage detected