[modules/disk] Backwards compatibility

Add support for showUsed, showSize and showPercent, but mark them as
deprecated.

see #151
This commit is contained in:
Tobias Witek 2017-08-02 05:52:53 +02:00
parent 2fcff4c2c9
commit e763b55b86
2 changed files with 35 additions and 5 deletions

View file

@ -74,6 +74,10 @@ class Module(object):
def update_all(self):
self.update(self._widgets)
def has_parameter(self, name):
v = self.parameter(name)
return v is not None
def parameter(self, name, default=None):
"""Return the config parameter 'name' for this module"""
name = "{}.{}".format(self.name, name)