MCPcopy Index your code
hub / github.com/RustPython/RustPython / addToZip

Function addToZip

Lib/zipfile/__init__.py:2409–2418  ·  view source on GitHub ↗
(zf, path, zippath)

Source from the content-addressed store, hash-verified

2407 files = args.create
2408
2409 def addToZip(zf, path, zippath):
2410 if os.path.isfile(path):
2411 zf.write(path, zippath, ZIP_DEFLATED)
2412 elif os.path.isdir(path):
2413 if zippath:
2414 zf.write(path, zippath)
2415 for nm in sorted(os.listdir(path)):
2416 addToZip(zf,
2417 os.path.join(path, nm), os.path.join(zippath, nm))
2418 # else: ignore
2419
2420 with ZipFile(zip_name, 'w') as zf:
2421 for path in files:

Callers 1

mainFunction · 0.85

Calls 6

sortedFunction · 0.85
listdirMethod · 0.80
isfileMethod · 0.45
writeMethod · 0.45
isdirMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected