Made string.Template module optional,

...it's required only for 'windows-installer' scons target.
This commit is contained in:
Sergey Popov 2010-03-28 21:02:55 +00:00
parent bbf5cc114e
commit 5805befe7a

View file

@ -2,10 +2,13 @@
# Shamelessly stolen from scons wiki
# http://www.scons.org/wiki/ReplacementBuilder
from string import Template
try:
from string import Template
class PercentDelimitedTemplate(Template):
delimiter = "%"
class PercentDelimitedTemplate(Template):
delimiter = "%"
except ImportError:
pass
def replace_action(target, source, env):
open(str(target[0]), 'w').write(PercentDelimitedTemplate(open(str(source[0]), 'r').read()).substitute(env))