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

Method blob_for

src/docx/opc/phys_pkg.py:44–49  ·  view source on GitHub ↗

Return contents of file corresponding to `pack_uri` in package directory.

(self, pack_uri)

Source from the content-addressed store, hash-verified

42 self._path = os.path.abspath(path)
43
44 def blob_for(self, pack_uri):
45 """Return contents of file corresponding to `pack_uri` in package directory."""
46 path = os.path.join(self._path, pack_uri.membername)
47 with open(path, "rb") as f:
48 blob = f.read()
49 return blob
50
51 def close(self):
52 """Provides interface consistency with |ZipFileSystem|, but does nothing, a

Calls 1

readMethod · 0.80