[modules] Re-enable nic module + allow widget states

All callback from a widget into a module (e.g. for retrieving the status
or the criticality state) now get a widget passed. This has the purpose
of allowing a module to store state/widget specific data somewhere. This
way, for instance, it is possible to store the interface name as part of
the widget, thus making it possible to show the status of the correct
interface.
This commit is contained in:
Tobias Witek 2016-11-05 13:42:26 +01:00
parent bd0089dac0
commit a9a62a738d
7 changed files with 74 additions and 84 deletions

View file

@ -33,13 +33,13 @@ class Module(bumblebee.module.Module):
bumblebee.util.bytefmt(self._size), self._perc)
)
def instance(self):
def instance(self, widget):
return self._path
def warning(self):
def warning(self, widget):
return self._perc > self._config.parameter("disk.warning", 80)
def critical(self):
def critical(self, widget):
return self._perc > self._config.parameter("disk.critical", 90)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4