Remove unneccessary style globals

This commit is contained in:
Florian Bruhin 2014-02-23 18:20:24 +01:00
parent 76a627bb10
commit ad29867aa6
2 changed files with 2 additions and 14 deletions

View File

@ -98,7 +98,6 @@ class QuteBrowser(QApplication):
else:
confdir = self._args.confdir
config.init(confdir)
style.init()
self.commandparser = cmdutils.CommandParser()
self.searchparser = cmdutils.SearchParser()

View File

@ -19,18 +19,6 @@
import qutebrowser.config.config as config
colordict = {}
fontdict = {}
def init():
"""Initialize the global objects based on the config."""
global colordict, fontdict
try:
colordict = ColorDict(config.config['colors'])
except KeyError:
colordict = ColorDict()
fontdict = FontDict(config.config['fonts'])
def get_stylesheet(template):
"""Format a stylesheet based on a template.
@ -42,7 +30,8 @@ def get_stylesheet(template):
The formatted template as string.
"""
return template.strip().format(color=colordict, font=fontdict)
return template.strip().format(color=ColorDict(config.config['colors']),
font=FontDict(config.config['fonts']))
class ColorDict(dict):