(path, outfile, directory = None)
| 169 | return path |
| 170 | |
| 171 | def ziptree(path, outfile, directory = None): |
| 172 | # Directory is similar to -C in tar |
| 173 | |
| 174 | zip = zipfile.ZipFile(outfile, 'w') |
| 175 | for root, dirs, files in os.walk(path): |
| 176 | for f in files: |
| 177 | p = os.path.join(root, f) |
| 178 | an = p |
| 179 | if directory: |
| 180 | an = os.path.relpath(p, directory) |
| 181 | zip.write(p, an) |
| 182 | |
| 183 | zip.close() |
| 184 | return outfile |
| 185 | |
| 186 | def gz_tree(path, outfile, directory=None): |
| 187 | # compress files and folders in path to outfile using tar:gz compression |
no test coverage detected