merge 'bypost' functionality into metadata postprocessor

This commit is contained in:
Mike Fährmann
2019-12-16 17:19:23 +01:00
parent c0b9ad678d
commit 63e6993716
6 changed files with 29 additions and 54 deletions

View File

@@ -40,6 +40,9 @@ class MetadataPP(PostProcessor):
self.path = self._path_append
self.extension = options.get("extension", ext)
if options.get("bypost"):
self.run_metadata, self.run = self.run, self.run_metadata
def run(self, pathfmt):
with open(self.path(pathfmt), "w", encoding="utf-8") as file:
self.write(file, pathfmt.kwdict)