(path)
| 28 | |
| 29 | |
| 30 | def simple_tar(path): |
| 31 | f = tempfile.NamedTemporaryFile() |
| 32 | t = tarfile.open(mode='w', fileobj=f) |
| 33 | |
| 34 | abs_path = os.path.abspath(path) |
| 35 | t.add(abs_path, arcname=os.path.basename(path), recursive=False) |
| 36 | |
| 37 | t.close() |
| 38 | f.seek(0) |
| 39 | return f |
| 40 | |
| 41 | |
| 42 | def untar_file(tardata, filename): |