diff options
author | Filippo Giunchedi <filippo@esaurito.net> | 2009-07-18 18:45:43 +0200 |
---|---|---|
committer | Filippo Giunchedi <filippo@esaurito.net> | 2009-07-18 18:45:43 +0200 |
commit | 98bacc9eff376513e5415175db00e6a869eb86a5 (patch) | |
tree | b3a6cdedc974388cb4bdaad0664bfb1046da9f78 | |
parent | ff593baa5a6b98060e4a665ffcf061188659aa0d (diff) | |
download | autoconf-archive-98bacc9eff376513e5415175db00e6a869eb86a5.tar.gz |
compatibility with st 3.1 StringTemplateGroup
pass file kwarg with a open() file instead of fileName which is 3.2 only
-rw-r--r-- | SConstruct | 4 | ||||
-rwxr-xr-x | macro.py | 2 |
2 files changed, 3 insertions, 3 deletions
@@ -5,8 +5,8 @@ import os.path as path from macro import Macro, writeFile from stringtemplate3 import StringTemplateGroup, StringTemplate -__formatters = { "canon.st" : StringTemplateGroup(fileName = "canon.st") - , "markdown.st" : StringTemplateGroup(fileName = "markdown.st") +__formatters = { "canon.st" : StringTemplateGroup(file = open("canon.st")) + , "markdown.st" : StringTemplateGroup(file = open("markdown.st")) } def formatMacro(target, source, env): @@ -123,7 +123,7 @@ if __name__ == "__main__": opts.add_option('', "--output-suffix", dest = "suffix", default = ".m4") (options, args) = opts.parse_args() stFile = args.pop(0) - formatter = StringTemplateGroup(fileName = stFile, lexer = options.lexer) + formatter = StringTemplateGroup(file = open(stFile), lexer = options.lexer) for m4File in args: (stem,suff) = path.splitext(path.basename(m4File)) assert suff == ".m4" |