(self, job, options)
| 24 | } |
| 25 | |
| 26 | def __init__(self, job, options): |
| 27 | PostProcessor.__init__(self, job) |
| 28 | self.delete = not options.get("keep-files", False) |
| 29 | self.files = options.get("files") |
| 30 | ext = "." + options.get("extension", "zip") |
| 31 | algorithm = options.get("compression", "store") |
| 32 | if algorithm not in self.COMPRESSION_ALGORITHMS: |
| 33 | self.log.warning( |
| 34 | "unknown compression algorithm '%s'; falling back to 'store'", |
| 35 | algorithm) |
| 36 | algorithm = "store" |
| 37 | |
| 38 | self.zfile = None |
| 39 | self.path = job.pathfmt.realdirectory[:-1] |
| 40 | self.args = (self.path + ext, "a", |
| 41 | self.COMPRESSION_ALGORITHMS[algorithm], True) |
| 42 | |
| 43 | job.register_hooks({ |
| 44 | "file": (self.write_safe if options.get("mode") == "safe" else |
| 45 | self.write_fast), |
| 46 | }, options) |
| 47 | job.hooks["finalize"].append(self.finalize) |
| 48 | |
| 49 | def open(self): |
| 50 | try: |
nothing calls this directly
no test coverage detected