Make rawvalue of SettingValue private

This commit is contained in:
Florian Bruhin 2014-04-09 22:44:34 +02:00
parent 4173a47ade
commit fb4e013007
2 changed files with 8 additions and 3 deletions

View File

@ -79,7 +79,7 @@ class SettingValue:
"""
self.typ = typ()
self.rawvalue = None
self._rawvalue = None
self.default = default
def __str__(self):
@ -94,7 +94,12 @@ class SettingValue:
@property
def value(self):
"""Get the currently valid value."""
return self.rawvalue if self.rawvalue is not None else self.default
return self._rawvalue if self._rawvalue is not None else self.default
@value.setter
def value(self, val):
"""Set the currently valid value."""
self._rawvalue = val
class BaseType:

View File

@ -97,7 +97,7 @@ class KeyValue:
"""Initialize the values from a configparser section."""
for k, v in sect.items():
logging.debug("'{}' = '{}'".format(k, v))
self.values[k].rawvalue = v
self.values[k].value = v
class ValueList: