Commit 211bd4d7 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

Fix basic templating to escape $$

parent adb93971
...@@ -42,22 +42,15 @@ class Recipe(object): ...@@ -42,22 +42,15 @@ class Recipe(object):
hidden_option = '__template_content_%s__' % name hidden_option = '__template_content_%s__' % name
inputfile = open(path, 'r') with open(path) as inputfile:
try: self.output_content = '$'.join(options._sub(s, None)
# Using internal buildout templating system for s in inputfile.read().split('$$'))
options._cooked[hidden_option] = inputfile.read()
self.output_content = options[hidden_option]
finally:
inputfile.close()
self.output_filename = options['output'] self.output_filename = options['output']
def install(self): def install(self):
outputfile = open(self.output_filename, 'w') with open(self.output_filename, 'w') as outputfile:
try:
outputfile.write(self.output_content) outputfile.write(self.output_content)
finally:
outputfile.close()
if self.mode is not None: if self.mode is not None:
os.chmod(self.output_filename, self.mode) os.chmod(self.output_filename, self.mode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment