diff --git a/qutebrowser/commands/keys.py b/qutebrowser/commands/keys.py index 34882124f..407a4b861 100644 --- a/qutebrowser/commands/keys.py +++ b/qutebrowser/commands/keys.py @@ -249,12 +249,12 @@ class KeyParser(QObject): # normalize keystring keystr = self._normalize_keystr(key.value.strip('@')) logging.debug('registered mod key: {} -> {}'.format(keystr, - cmd)) - self._modifier_bindings[keystr] = cmd + cmd.value)) + self._modifier_bindings[keystr] = cmd.value else: logging.debug('registered key: {} -> {}'.format(key.value, - cmd)) - self._bindings[key] = cmd + cmd.value)) + self._bindings[key.value] = cmd.value def handle(self, e): """Handle a new keypress and call the respective handlers. diff --git a/qutebrowser/commands/parsers.py b/qutebrowser/commands/parsers.py index 0f095d4f1..8ebbbf8e1 100644 --- a/qutebrowser/commands/parsers.py +++ b/qutebrowser/commands/parsers.py @@ -147,7 +147,7 @@ class CommandParser(QObject): if aliases: try: alias = config.config.get('aliases', cmdstr) - except config.NoOptionError: + except KeyError: pass else: return self._parse(alias, aliases=False) diff --git a/qutebrowser/config/style.py b/qutebrowser/config/style.py index 015c048e8..496e06455 100644 --- a/qutebrowser/config/style.py +++ b/qutebrowser/config/style.py @@ -17,6 +17,8 @@ """Utilities related to the look&feel of qutebrowser.""" +import logging + import qutebrowser.config.config as config @@ -30,8 +32,10 @@ def get_stylesheet(template): The formatted template as string. """ - return template.strip().format(color=ColorDict(config.config['colors']), - font=FontDict(config.config['fonts'])) + cdict = config.config['colors'].values + fdict = config.config['fonts'].values + return template.strip().format(color=ColorDict(cdict), + font=FontDict(fdict)) class ColorDict(dict): diff --git a/qutebrowser/config/templates.py b/qutebrowser/config/templates.py index 726b86194..4d312132a 100644 --- a/qutebrowser/config/templates.py +++ b/qutebrowser/config/templates.py @@ -18,6 +18,7 @@ """Templates for setting options.""" import logging +from collections import OrderedDict import qutebrowser.commands.utils as cmdutils @@ -250,7 +251,7 @@ class ValueListSection: def __init__(self): """Wrap types over default values. Take care when overriding this.""" - logging.debug("Default before wrapping: {}".format(self.default)) + self.values = OrderedDict() self.default = {self.types[0](key): self.types[1](value) for key, value in self.default.items()} @@ -272,7 +273,7 @@ class ValueListSection: try: return self.values[key] except KeyError: - return self.defaults[key] + return self.default[key] def __iter__(self): """Iterate over all set values."""