MCPcopy Create free account
hub / github.com/culvertsoft/mgen / zipdir

Function zipdir

buildutil.py:147–155  ·  view source on GitHub ↗
(basedir, archivename)

Source from the content-addressed store, hash-verified

145# Zip utils
146
147def zipdir(basedir, archivename):
148 assert os.path.isdir(basedir)
149 with closing(ZipFile(archivename, "w", ZIP_DEFLATED)) as z:
150 for root, dirs, files in os.walk(basedir):
151 #NOTE: ignore empty directories
152 for fn in files:
153 absfn = os.path.join(root, fn)
154 zfn = absfn[len(basedir)+len(os.sep):] #XXX: relative path
155 z.write(absfn, zfn)
156
157def unzip(file, outPath):
158 fh = open(file, 'rb')

Callers 1

create_install_zipFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected