[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:
parent
bd0089dac0
commit
a9a62a738d
7 changed files with 74 additions and 84 deletions
|
@ -36,24 +36,16 @@ class Module(object):
|
|||
self._config = config
|
||||
self._output = output
|
||||
|
||||
def data(self):
|
||||
pass
|
||||
|
||||
def critical(self):
|
||||
def critical(self, widget):
|
||||
return False
|
||||
|
||||
def warning(self):
|
||||
def warning(self, widget):
|
||||
return False
|
||||
|
||||
def state(self):
|
||||
def state(self, widget):
|
||||
return "default"
|
||||
|
||||
def instance(self):
|
||||
def instance(self, widget):
|
||||
return None
|
||||
|
||||
def next(self):
|
||||
return False
|
||||
|
||||
|
||||
|
||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue