summaryrefslogtreecommitdiff
path: root/pywal/export.py
diff options
context:
space:
mode:
authordylan <dylan.araps@gmail.com>2020-05-13 13:57:06 +0300
committerGitHub <noreply@github.com>2020-05-13 13:57:06 +0300
commitad9b05ba93b1bdd88e15d4c5ef66447719985b79 (patch)
treeb1f1afef7f3208984be848ffb867941f3201c1a1 /pywal/export.py
parenteb4200820b13006e2434bbc0bb402ed89726d042 (diff)
parent526c399650eec81d75804ed09702594a5164083d (diff)
Merge pull request #527 from hhell/patch-1
Fix for kitty alpha_dec replacer
Diffstat (limited to 'pywal/export.py')
-rw-r--r--pywal/export.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pywal/export.py b/pywal/export.py
index 928fbc3..8f581b9 100644
--- a/pywal/export.py
+++ b/pywal/export.py
@@ -57,14 +57,15 @@ def template(colors, input_file, output_file=None):
new_color = new_color.strip
# If the color was changed, replace with a unique identifier.
if new_color is not colors[cname]:
- new_color_clean = new_color.replace('[', '_').replace(']', '_')
+ new_color = str(new_color)
+ new_color_clean = new_color.replace('[', '_').replace(']', '_').replace('.', '_')
template_data[i] = l.replace(replace_str,
"color" + new_color_clean)
colors["color" + new_color_clean] = new_color
try:
template_data = "".join(template_data).format(**colors)
- except ValueError:
- logging.error("Syntax error in template file '%s'.", input_file)
+ except (ValueError, KeyError, AttributeError) as exc:
+ logging.error("Syntax error in template file '%s': %r.", input_file, exc)
return
util.save_file(template_data, output_file)