mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-06-14 21:56:44 +02:00
Fix longline for flake8
This commit is contained in:
parent
919ea7533a
commit
0ac6ef2a66
@ -58,14 +58,18 @@ def template(colors, input_file, output_file=None):
|
|||||||
# If the color was changed, replace with a unique identifier.
|
# If the color was changed, replace with a unique identifier.
|
||||||
if new_color is not colors[cname]:
|
if new_color is not colors[cname]:
|
||||||
new_color = str(new_color)
|
new_color = str(new_color)
|
||||||
new_color_clean = new_color.replace('[', '_').replace(']', '_').replace('.', '_')
|
new_color_clean = (new_color.replace('[', '_')
|
||||||
|
.replace(']', '_')
|
||||||
|
.replace('.', '_'))
|
||||||
template_data[i] = l.replace(replace_str,
|
template_data[i] = l.replace(replace_str,
|
||||||
"color" + new_color_clean)
|
"color" + new_color_clean)
|
||||||
colors["color" + new_color_clean] = new_color
|
colors["color" + new_color_clean] = new_color
|
||||||
try:
|
try:
|
||||||
template_data = "".join(template_data).format(**colors)
|
template_data = "".join(template_data).format(**colors)
|
||||||
except (ValueError, KeyError, AttributeError) as exc:
|
except (ValueError, KeyError, AttributeError) as exc:
|
||||||
logging.error("Syntax error in template file '%s': %r.", input_file, exc)
|
logging.error(
|
||||||
|
"Syntax error in template file '%s': %r.",
|
||||||
|
input_file, exc)
|
||||||
return
|
return
|
||||||
util.save_file(template_data, output_file)
|
util.save_file(template_data, output_file)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user