Commit c2e905b1 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Templates: Create default dir (to be used by all templates as fallback)

parent ff48f796
......@@ -14,4 +14,6 @@
"<< e.sku >>": {"ismn": "<<e.ismn>>", "comment": "<<e.comment>>", "price": <<e.price|default(0.00)>>}, # << e.type >>
<$- endfor $>
},
"Productimages": [
],
}
......@@ -186,9 +186,10 @@ class Settings:
global program_name;
global script_path;
templatename = self.get_template_name ();
self.defaulttemplatepath = script_path + '/Templates/default';
self.templatepath = script_path + '/Templates/' + templatename;
self.template_env = Environment (
loader = FileSystemLoader(self.templatepath),
loader = FileSystemLoader([self.templatepath,self.defaulttemplatepath]),
block_start_string = '<$', block_end_string = '$>',
variable_start_string = '<<', variable_end_string = '>>',
comment_start_string = '<#', comment_end_string = '#>',
......@@ -369,7 +370,7 @@ def write_settings_file_if_exists (settings, score_settings, template, filename)
filename = settings.assemble_settings_filename (basename, filename);
write_file (settings.out_dir, filename, template.render (score_settings));
return filename;
except jinja2.exceptions.TemplateNotFound:
except jinja2.exceptions.TemplateNotFound as e:
return None;
def generate_settings_files (score_name, score_settings, settings, settings_files):
......
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