From ad29867aa6201c7c9a50be65aad6a93e9c7727de Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 23 Feb 2014 18:20:24 +0100 Subject: [PATCH] Remove unneccessary style globals --- qutebrowser/app.py | 1 - qutebrowser/config/style.py | 15 ++------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index a8aecb562..9106fbcd4 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -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() diff --git a/qutebrowser/config/style.py b/qutebrowser/config/style.py index 119cbddbe..015c048e8 100644 --- a/qutebrowser/config/style.py +++ b/qutebrowser/config/style.py @@ -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):