Config bugfixes.

Stylesheet still broken, but at least keybindings work.
This commit is contained in:
Florian Bruhin 2014-02-26 07:58:18 +01:00
parent f079d6bf3b
commit 369ee1f47e
4 changed files with 14 additions and 9 deletions

View File

@ -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.

View File

@ -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)

View File

@ -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):

View File

@ -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."""