From fb4e013007e10c8e4df7fe0c695b9525dd3d01e6 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 9 Apr 2014 22:44:34 +0200 Subject: [PATCH] Make rawvalue of SettingValue private --- qutebrowser/config/conftypes.py | 9 +++++++-- qutebrowser/config/sections.py | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/qutebrowser/config/conftypes.py b/qutebrowser/config/conftypes.py index 823a5c15c..6c45d14f5 100644 --- a/qutebrowser/config/conftypes.py +++ b/qutebrowser/config/conftypes.py @@ -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: diff --git a/qutebrowser/config/sections.py b/qutebrowser/config/sections.py index 9f349bd5b..f56eaa62f 100644 --- a/qutebrowser/config/sections.py +++ b/qutebrowser/config/sections.py @@ -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: