[formatting] reformat using "black -t py34"
getting rid of thinking about consistent formatting...
This commit is contained in:
parent
fa98bcbdd1
commit
30c1f712a6
119 changed files with 3961 additions and 3495 deletions
|
@ -1,11 +1,11 @@
|
|||
# pylint: disable=C0111,R0903
|
||||
|
||||
'''Displays system load.
|
||||
"""Displays system load.
|
||||
|
||||
Parameters:
|
||||
* load.warning : Warning threshold for the one-minute load average (defaults to 70% of the number of CPUs)
|
||||
* load.critical: Critical threshold for the one-minute load average (defaults to 80% of the number of CPUs)
|
||||
'''
|
||||
"""
|
||||
|
||||
import os
|
||||
import multiprocessing
|
||||
|
@ -13,6 +13,7 @@ import multiprocessing
|
|||
import core.module
|
||||
import core.input
|
||||
|
||||
|
||||
class Module(core.module.Module):
|
||||
def __init__(self, config, theme):
|
||||
super().__init__(config, theme, core.widget.Widget(self.load))
|
||||
|
@ -21,11 +22,12 @@ class Module(core.module.Module):
|
|||
self._cpus = multiprocessing.cpu_count()
|
||||
except NotImplementedError as e:
|
||||
self._cpus = 1
|
||||
core.input.register(self, button=core.input.LEFT_MOUSE,
|
||||
cmd='gnome-system-monitor')
|
||||
core.input.register(
|
||||
self, button=core.input.LEFT_MOUSE, cmd="gnome-system-monitor"
|
||||
)
|
||||
|
||||
def load(self, widget):
|
||||
return '{:.02f}/{:.02f}/{:.02f}'.format(
|
||||
return "{:.02f}/{:.02f}/{:.02f}".format(
|
||||
self._load[0], self._load[1], self._load[2]
|
||||
)
|
||||
|
||||
|
@ -33,6 +35,7 @@ class Module(core.module.Module):
|
|||
self._load = os.getloadavg()
|
||||
|
||||
def state(self, widget):
|
||||
return self.threshold_state(self._load[0], self._cpus*0.7, self._cpus*0.8)
|
||||
return self.threshold_state(self._load[0], self._cpus * 0.7, self._cpus * 0.8)
|
||||
|
||||
|
||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue