daemon: Make Configurable.valueof() a class method.
This commit is contained in:
parent
a02c9a3f6e
commit
e9a4a52755
1 changed files with 5 additions and 5 deletions
|
@ -337,14 +337,14 @@ class Configurable(object):
|
||||||
return 0
|
return 0
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
@classmethod
|
||||||
def valueof(self, name, values):
|
def valueof(cls, name, values):
|
||||||
''' Helper to return a value by the name defined in confmatrix.
|
''' Helper to return a value by the name defined in confmatrix.
|
||||||
Checks if it is boolean'''
|
Checks if it is boolean'''
|
||||||
i = self.getnames().index(name)
|
i = cls.getnames().index(name)
|
||||||
if self._confmatrix[i][1] == coreapi.CONF_DATA_TYPE_BOOL and \
|
if cls._confmatrix[i][1] == coreapi.CONF_DATA_TYPE_BOOL and \
|
||||||
values[i] != "":
|
values[i] != "":
|
||||||
return self.booltooffon( values[i] )
|
return cls.booltooffon(values[i])
|
||||||
else:
|
else:
|
||||||
return values[i]
|
return values[i]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue