Zip the files in tree into a new zipfile at dst.
(tree, dst)
| 6 | |
| 7 | |
| 8 | def make_zip_file(tree, dst): |
| 9 | """ |
| 10 | Zip the files in tree into a new zipfile at dst. |
| 11 | """ |
| 12 | with zipfile.ZipFile(dst, 'w') as zf: |
| 13 | for name, contents in walk(tree): |
| 14 | zf.writestr(name, contents) |
| 15 | zipfile._path.CompleteDirs.inject(zf) |
| 16 | return dst |
| 17 | |
| 18 | |
| 19 | def walk(tree, prefix=''): |