Index: Source/build/scripts/template_expander.py |
diff --git a/Source/build/scripts/template_expander.py b/Source/build/scripts/template_expander.py |
index d06db60690aa54eb758aed2036c56b78e3fd1fef..2edb5abc9b17765dc218170a46f7ece746a5cfc4 100644 |
--- a/Source/build/scripts/template_expander.py |
+++ b/Source/build/scripts/template_expander.py |
@@ -39,7 +39,11 @@ import jinja2 |
def apply_template(path_to_template, params, filters=None): |
dirname, basename = os.path.split(path_to_template) |
path_to_templates = os.path.join(_current_dir, 'templates') |
- jinja_env = jinja2.Environment(loader=jinja2.FileSystemLoader([dirname, path_to_templates]), keep_trailing_newline=True) |
+ jinja_env = jinja2.Environment( |
+ loader=jinja2.FileSystemLoader([dirname, path_to_templates]), |
+ keep_trailing_newline=True, # newline-terminate generated files |
+ lstrip_blocks=True, # so can indent control flow tags |
+ trim_blocks=True) # so don't need {%- -%} everywhere |
if filters: |
jinja_env.filters.update(filters) |
template = jinja_env.get_template(basename) |