Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit ad9b05b

Browse files
authored
Merge pull request #527 from hhell/patch-1
Fix for kitty alpha_dec replacer
2 parents eb42008 + 526c399 commit ad9b05b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pywal/export.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,15 @@ def template(colors, input_file, output_file=None):
5757
new_color = new_color.strip
5858
# If the color was changed, replace with a unique identifier.
5959
if new_color is not colors[cname]:
60-
new_color_clean = new_color.replace('[', '_').replace(']', '_')
60+
new_color = str(new_color)
61+
new_color_clean = new_color.replace('[', '_').replace(']', '_').replace('.', '_')
6162
template_data[i] = l.replace(replace_str,
6263
"color" + new_color_clean)
6364
colors["color" + new_color_clean] = new_color
6465
try:
6566
template_data = "".join(template_data).format(**colors)
66-
except ValueError:
67-
logging.error("Syntax error in template file '%s'.", input_file)
67+
except (ValueError, KeyError, AttributeError) as exc:
68+
logging.error("Syntax error in template file '%s': %r.", input_file, exc)
6869
return
6970
util.save_file(template_data, output_file)
7071

0 commit comments

Comments
 (0)