mirror of
https://github.com/dylanaraps/pywal.git
synced 2024-11-29 03:13:47 +01:00
export: Print error message if template can't be parsed.
This commit is contained in:
parent
668f9bbd5b
commit
1d4127925d
@ -12,7 +12,13 @@ def template(colors, input_file, output_file=None):
|
||||
"""Read template file, substitute markers and
|
||||
save the file elsewhere."""
|
||||
template_data = util.read_file_raw(input_file)
|
||||
template_data = "".join(template_data).format(**colors)
|
||||
|
||||
try:
|
||||
template_data = "".join(template_data).format(**colors)
|
||||
except ValueError:
|
||||
logging.error("Syntax error in template file '%s'. "
|
||||
"Are non-marker braces escaped? '{{}}'?" % input_file)
|
||||
return
|
||||
|
||||
util.save_file(template_data, output_file)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user