MCPcopy Index your code
hub / github.com/python/cpython / inject

Method inject

Lib/zipfile/_path/__init__.py:166–173  ·  view source on GitHub ↗

Given a writable zip file zf, inject directory entries for any directories implied by the presence of children.

(cls, zf: zipfile.ZipFile)

Source from the content-addressed store, hash-verified

164
165 @classmethod
166 def inject(cls, zf: zipfile.ZipFile) -> zipfile.ZipFile:
167 """
168 Given a writable zip file zf, inject directory entries for
169 any directories implied by the presence of children.
170 """
171 for name in cls._implied_dirs(zf.namelist()):
172 zf.writestr(name, b"")
173 return zf
174
175
176class FastLookup(CompleteDirs):

Callers 1

make_zip_fileFunction · 0.80

Calls 3

_implied_dirsMethod · 0.80
writestrMethod · 0.80
namelistMethod · 0.45

Tested by

no test coverage detected