diff options
author | Richard Darst <rkd@zgib.net> | 2009-09-24 06:18:04 (GMT) |
---|---|---|
committer | Richard Darst <rkd@zgib.net> | 2009-09-24 06:18:04 (GMT) |
commit | 5d10f64f7bb6f3acfa7482ce6ab42873eda8a612 (patch) | |
tree | ab92b6c8a203c09a6de2713182ba5379c555fa71 | |
parent | a51699b87fae0f8368849e1e59b1dbcb8853e6cf (diff) |
Add argument parsing for writer extensions
- The syntax is this:
writer_map[".txt|template
darcs-hash:20090924061804-82ea9-3eb26b5e91373851376ef0895c070e9265843907.gz
-rw-r--r-- | meeting.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -194,7 +194,15 @@ class Config(object): getattr(self, '_filename', None) ) ): continue - text = writer.format(extension) + # Parse embedded arguments + if '|' in extension: + extension, args = extension.split('|', 1) + args = args.split('|') + args = dict([a.split('=', 1) for a in args] ) + else: + args = { } + + text = writer.format(extension, **args) results[extension] = text # If the writer returns a string or unicode object, then # we should write it to a filename with that extension. |