update PathFormat class
- change 'has_extension' from a simple flag/bool to a field that contains the original filename extension - rename 'keywords' to 'kwdict' and some other stuff as well - inline 'adjust_path()' - put enumeration index before filename extension (#306)
This commit is contained in:
@@ -19,9 +19,9 @@ class MtimePP(PostProcessor):
|
||||
self.key = options.get("key", "date")
|
||||
|
||||
def run(self, pathfmt):
|
||||
mtime = pathfmt.keywords.get(self.key)
|
||||
mtime = pathfmt.kwdict.get(self.key)
|
||||
ts = getattr(mtime, "timestamp", None)
|
||||
pathfmt.keywords["_mtime"] = ts() if ts else parse_int(mtime)
|
||||
pathfmt.kwdict["_mtime"] = ts() if ts else parse_int(mtime)
|
||||
|
||||
|
||||
__postprocessor__ = MtimePP
|
||||
|
||||
Reference in New Issue
Block a user