Made string.Template module optional,
...it's required only for 'windows-installer' scons target.
This commit is contained in:
parent
bbf5cc114e
commit
5805befe7a
1 changed files with 6 additions and 3 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue