improve postprocessor handling

- add pathfmt argument for __init__()
- add finalization step
- add option to keep or delete zipped files
This commit is contained in:
Mike Fährmann
2018-06-08 17:39:02 +02:00
parent 2628911ba0
commit baccf8a958
6 changed files with 75 additions and 47 deletions

View File

@@ -359,6 +359,7 @@ class PathFormat():
"directory", extractor.directory_fmt)
self.formatter = Formatter(extractor.config("keywords-default"))
self.delete = False
self.has_extension = False
self.keywords = {}
self.filename = ""
@@ -472,6 +473,10 @@ class PathFormat():
def finalize(self):
"""Move tempfile to its target location"""
if self.delete:
os.unlink(self.temppath)
return
if self.temppath == self.realpath:
return