t-wissmann / barpyrus

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

Handle EOF correctly #15

Closed The-Compiler closed 3 years ago

The-Compiler commented 3 years ago

When e.g. doing "hc quit", one would get:

  Traceback (most recent call last):
    File ".../barpyrus/mainloop.py", line 47, in main
      main_loop(bar)
    File ".../barpyrus/mainloop.py", line 95, in main_loop
      x.process()
    File ".../barpyrus/core.py", line 50, in process
      for line in self.readlines():
  TypeError: 'NoneType' object is not iterable
t-wissmann commented 3 years ago

By the way, I swapped the for and the with line in order to print a reasonable error message showing the reason for the exit: https://github.com/t-wissmann/barpyrus/commit/fa160c69634776d696a4e5bfa02139acad3ad3c9