dylanaraps / pywal

🎨 Generate and change color-schemes on the fly.
MIT License
8.42k stars 327 forks source link

accessing a color attribute replaces the identifier #495

Open patzm opened 4 years ago

patzm commented 4 years ago

pywal version v3.3.0 Python 3.7.7

Minimal source file in ~/.config/wal/templates

background_opacity {background.alpha_num}

Calling

wal -n -a 80 --theme base16-google

creates the following file in ~/.cache/wal

color1d1f21_opacity 80

You can see that background got replaced with the hexadecimal representation of itself. This happenes here: https://github.com/dylanaraps/pywal/blob/ee50fb3ab394a117295acdfe0fa9b149c280942a/pywal/export.py#L51-L54

I didn't exactly get the intention of this replacement, so not sure exactly how to fix it :thinking: .

patzm commented 4 years ago

Fixed by #485.

patzm commented 4 years ago

Sorry, have to re-open again. I installed commit eb4200820b13006e2434bbc0bb402ed89726d042. Executing

wal -n -a 80 --theme base16-google

Throws the following traceback:

Traceback (most recent call last):
  File "/home/patzm/.local/bin/wal", line 11, in <module>
    load_entry_point('pywal', 'console_scripts', 'wal')()
  File "/usr/lib/python3.8/site-packages/pywal/__main__.py", line 231, in main
    parse_args(parser)
  File "/usr/lib/python3.8/site-packages/pywal/__main__.py", line 208, in parse_args
    export.every(colors_plain)
  File "/usr/lib/python3.8/site-packages/pywal/export.py", line 121, in every
    template(colors, file.path, join(output_dir, file.name))
  File "/usr/lib/python3.8/site-packages/pywal/export.py", line 60, in template
    new_color_clean = new_color.replace('[', '_').replace(']', '_')
AttributeError: 'float' object has no attribute 'replace'

This breaks even without custom templates. The above change was introduced by #485. Maybe something upstream changed such that this is now breaking.