t-wissmann / barpyrus

A python wrapper for lemonbar
Other
33 stars 7 forks source link

cg.space results in AttributeError: 'LBPainter' object has no attribute 'spacing_font_width' #18

Closed The-Compiler closed 2 years ago

The-Compiler commented 2 years ago

With:

from barpyrus import lemonbar, conky

cg = conky.ConkyGenerator(lemonbar.textpainter())
cg.space(50)

I get:

Traceback (most recent call last):
  File "/home/florian/proj/barpyrus/barpyrus.py", line 7, in <module>
    sys.exit(barpyrus.mainloop.main())
  File "/home/florian/proj/barpyrus/barpyrus/mainloop.py", line 45, in main
    conf = get_user_config()
  File "/home/florian/proj/barpyrus/barpyrus/mainloop.py", line 39, in get_user_config
    return get_config(user_config_path())
  File "/home/florian/proj/barpyrus/barpyrus/mainloop.py", line 24, in get_config
    exec(code, global_vars)
  File "/home/florian/tmp/barp.py", line 4, in <module>
    cg.space(50)
  File "/home/florian/proj/barpyrus/barpyrus/lemonbar.py", line 103, in space
    factor = self.lemonbar.spacing_font_width
  File "/home/florian/proj/barpyrus/barpyrus/conky.py", line 208, in __getattr__
    return self._painter.__getattribute__(name)
AttributeError: 'LBPainter' object has no attribute 'spacing_font_width'

which is a regression introduced in f33053496e13c388942d598e29e78662443b86c5 ("More spacing options").

t-wissmann commented 2 years ago

Thanks for reporting and sorry for the trouble! I've tried a quick fix in e2c758d . What do you think about it?