(zip_path, output=None)
| 163 | |
| 164 | |
| 165 | def zip_dir(zip_path, output=None): |
| 166 | output = output or os.path.basename(zip_path) + '.zip' |
| 167 | zip = zipfile.ZipFile(output, 'w', zipfile.ZIP_DEFLATED) |
| 168 | for root, dirs, files in os.walk(zip_path): |
| 169 | relative_root = '' if root == zip_path else root.replace(zip_path, '') + os.sep |
| 170 | for filename in files: |
| 171 | zip.write(os.path.join(root, filename), relative_root + filename) |
| 172 | zip.close() |
| 173 | |
| 174 | |
| 175 | def is_valid_uuid(s): |
no test coverage detected