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

Method __getitem__

src/pptx/opc/serialized.py:182–189  ·  view source on GitHub ↗

Return bytes for part corresponding to `pack_uri`. Raises |KeyError| if no matching member is present in zip archive.

(self, pack_uri: PackURI)

Source from the content-addressed store, hash-verified

180 return pack_uri in self._blobs
181
182 def __getitem__(self, pack_uri: PackURI) -> bytes:
183 """Return bytes for part corresponding to `pack_uri`.
184
185 Raises |KeyError| if no matching member is present in zip archive.
186 """
187 if pack_uri not in self._blobs:
188 raise KeyError("no member '%s' in package" % pack_uri)
189 return self._blobs[pack_uri]
190
191 @lazyproperty
192 def _blobs(self) -> dict[PackURI, bytes]:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected