From 7312a284a387c1b6fef4c613f56c30ce0c07c057 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 7 Apr 2014 16:51:14 +0200 Subject: [PATCH] More fixes, kinda runs now --- qutebrowser/config/config.py | 8 ++++++-- qutebrowser/config/style.py | 12 ++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index 7dc1975a2..da6fc2cc1 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -181,10 +181,10 @@ class Config: return fallback else: if raw: - return val + return val.value newval = self._interpolation.before_get( self, section, option, val.value, - self.config[section].values) + {key: val.value for key, val in self.config[section].values.items()}) logging.debug("interpolated val: {}".format(newval)) newval = val.typ.transform(newval) return newval @@ -207,6 +207,10 @@ class Config: # FIXME to be implemented pass + def optionxform(self, val): + """Implemented to be compatible with ConfigParser interpolation.""" + return val + class ReadConfigParser(ConfigParser): diff --git a/qutebrowser/config/style.py b/qutebrowser/config/style.py index 963dcbe2b..e3aa32c47 100644 --- a/qutebrowser/config/style.py +++ b/qutebrowser/config/style.py @@ -30,8 +30,8 @@ def get_stylesheet(template): The formatted template as string. """ - cdict = config.config['colors'].values - fdict = config.config['fonts'].values + cdict = config.config['colors'] + fdict = config.config['fonts'] return template.strip().format(color=ColorDict(cdict), font=FontDict(fdict)) @@ -61,7 +61,7 @@ class ColorDict(dict): """ try: - val = super().__getitem__(key).value + val = super().__getitem__(key) except KeyError: return '' if 'fg' in key.split('.'): @@ -82,7 +82,7 @@ class ColorDict(dict): """ try: - return super().__getitem__(key).value + return super().__getitem__(key) except KeyError: return None @@ -105,7 +105,7 @@ class FontDict(dict): """ try: - val = super().__getitem__(key).value + val = super().__getitem__(key) except KeyError: return '' else: @@ -122,6 +122,6 @@ class FontDict(dict): """ try: - return super().__getitem__(key).value + return super().__getitem__(key) except KeyError: return None