MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / addToZip

Function addToZip

tools/python-3.11.9-amd64/Lib/zipfile.py:2567–2576  ·  view source on GitHub ↗
(zf, path, zippath)

Source from the content-addressed store, hash-verified

2565 files = args.create
2566
2567 def addToZip(zf, path, zippath):
2568 if os.path.isfile(path):
2569 zf.write(path, zippath, ZIP_DEFLATED)
2570 elif os.path.isdir(path):
2571 if zippath:
2572 zf.write(path, zippath)
2573 for nm in sorted(os.listdir(path)):
2574 addToZip(zf,
2575 os.path.join(path, nm), os.path.join(zippath, nm))
2576 # else: ignore
2577
2578 with ZipFile(zip_name, 'w') as zf:
2579 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