(zf, path, zippath)
| 2363 | files = args.create |
| 2364 | |
| 2365 | def addToZip(zf, path, zippath): |
| 2366 | if os.path.isfile(path): |
| 2367 | zf.write(path, zippath, ZIP_DEFLATED) |
| 2368 | elif os.path.isdir(path): |
| 2369 | if zippath: |
| 2370 | zf.write(path, zippath) |
| 2371 | for nm in sorted(os.listdir(path)): |
| 2372 | addToZip(zf, |
| 2373 | os.path.join(path, nm), os.path.join(zippath, nm)) |
| 2374 | # else: ignore |
| 2375 | |
| 2376 | with ZipFile(zip_name, 'w') as zf: |
| 2377 | for path in files: |