| 1 |
|
| 2 |
|
| 3 |
n |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
"""Trigger directory format string evaluation""" |
| 10 |
|
| 11 |
from .common import PostProcessor |
| 12 |
|
| 13 |
|
| 14 |
class DirectoryPP(PostProcessor): |
| 15 |
|
| 16 |
def __init__(self, job, options): |
| 17 |
PostProcessor.__init__(self, job) |
| 18 |
|
| 19 |
events = options.get("event") |
| 20 |
if events is None: |
| 21 |
events = ("prepare",) |
| 22 |
elif isinstance(events, str): |
| 23 |
events = events.split(",") |
| 24 |
job.register_hooks({event: self.run for event in events}, options) |
| 25 |
|
| 26 |
def run(self, pathfmt): |
| 27 |
pathfmt.set_directory(pathfmt.kwdict) |
| 28 |
|
| 29 |
|
| 30 |
__postprocessor__ = DirectoryPP |