Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wasn't completely happy with my first refactor, it left too much chart stuff in
disks.py
and vice versa.charts.py
,disks.py
, and just a bit incli.py
have been reworked. Overall it's a MUCH better structure. From here it should be easy to add any other charts, specifically whateverpsutil
can grab.charts.py
now has proper setters and gettersI'm torn on how to handle colors/attributes. Right now the setters for colors don't use the old
enum
structure and assumes the incoming is text and converts it viafg(color)
which, of course, means only foreground colors work, but all 256 colors work. I was hoping I could check to see it was a string, but unfortunatelyfg(color)
returns a string. I'm hoping someone has a better idea of how the color setters should/could be implemented to account for accepting plain text and converting it (e.g. from the command line) and existing formatting strings (e.g. bg(color) or attr(attribute))The only other outstanding issue is that "details" doesn't seem to be getting passed on from the cli.
At the bottom of each module I added a
if __name__ == "__main__" ....
section that runs a quick sanity check. charts.py prints a test chart and disks.py prints charts of everything with detailsSo it's not "done" just yet, but it needs some more eyes on it before going into master. There are no other branches available though.