enkore / i3pystatus

A complete replacement for i3status
https://i3pystatus.readthedocs.io/
MIT License
445 stars 188 forks source link

Added TLP module #707

Closed netvl closed 5 years ago

netvl commented 5 years ago

This module allows for displaying the status of the TLP system (power management tools), which can be either AC, battery or unknown (in case TLP is not running, for example). It is a very simple module which reads from a particular file and interprets the value in it to display it with correct semantics.

chestm007 commented 5 years ago

You'll have to list pathlib in docs/conf.pyto get the tests to pass

Also, is there a strong reasoning to use pathlib.Path as opposed to os.path in this case?

netvl commented 5 years ago

@chestm007 not really, it's just I thought that pathlib is the modern API for working with paths and files, so it is supposed to be used by default. I think I'll just change it to the regular open call then, to keep things simpler.

netvl commented 5 years ago

The tests are still failing, but not because of my changes:

+python3 -mpycodestyle i3pystatus tests
i3pystatus/timewarrior.py:52:17: E117 over-indented
i3pystatus/timewarrior.py:54:17: E117 over-indented
i3pystatus/core/settings.py:118:17: E117 over-indented (comment)
i3pystatus/core/settings.py:119:17: E117 over-indented
i3pystatus/core/util.py:567:13: E117 over-indented
i3pystatus/core/util.py:569:13: E117 over-indented
chestm007 commented 5 years ago

hmm yeah, the lines being flagged have been like that for ages - maybe the linter changed upstream - i'll merge anyway.