Render cpu_load_percent segment even when psutil returns 0.0 (#2111)

Although the docs for psutil say 0.0 is a nonsense value that's returned
first and supposed to be ignored, but on a relatively idle system it
will actually return 0.0 occasionally after that. So at the expense of
displaying that "nonsense value" when the statusbar first loads, this
change gets rid of the visual disruptions of having the segment pop out
and back in periodically.

Fixes #2110.

Co-authored-by: 2rs2ts <2rs2ts@github>
This commit is contained in:
Andrew Garrett 2020-07-12 03:31:52 -07:00 committed by GitHub
parent 14a4100c4c
commit 8c6874d855
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 2 deletions

View File

@ -90,8 +90,6 @@ try:
self.exception('Exception while calculating cpu_percent: {0}', str(e))
def render(self, cpu_percent, format='{0:.0f}%', **kwargs):
if not cpu_percent:
return None
return [{
'contents': format.format(cpu_percent),
'gradient_level': cpu_percent,