| 74 | self.write(pathfmt, zfile) |
| 75 | |
| 76 | def write_extra(self, pathfmt, zfile, files): |
| 77 | for path in map(util.expand_path, files): |
| 78 | if not os.path.isabs(path): |
| 79 | path = os.path.join(pathfmt.realdirectory, path) |
| 80 | try: |
| 81 | zfile.write(path, os.path.basename(path)) |
| 82 | except OSError as exc: |
| 83 | self.log.warning( |
| 84 | "Unable to write %s to %s", path, zfile.filename) |
| 85 | self.log.debug("%s: %s", exc, exc.__class__.__name__) |
| 86 | pass |
| 87 | else: |
| 88 | if self.delete: |
| 89 | util.remove_file(path) |
| 90 | |
| 91 | def finalize(self, pathfmt): |
| 92 | if self.zfile: |