def template(colors, input_file, output_file=None):
template_data = util.read_file_raw(input_file)<EOL>try:<EOL><INDENT>template_data = "<STR_LIT>".join(template_data).format(**colors)<EOL><DEDENT>except ValueError:<EOL><INDENT>logging.error("<STR_LIT>", input_file)<EOL>return<EOL><DEDENT>util.save_file(template_data, output_file)<EOL>
Read template file, substitute markers and
       save the file elsewhere.