Remove unneccessary style globals
This commit is contained in:
parent
76a627bb10
commit
ad29867aa6
@ -98,7 +98,6 @@ class QuteBrowser(QApplication):
|
|||||||
else:
|
else:
|
||||||
confdir = self._args.confdir
|
confdir = self._args.confdir
|
||||||
config.init(confdir)
|
config.init(confdir)
|
||||||
style.init()
|
|
||||||
|
|
||||||
self.commandparser = cmdutils.CommandParser()
|
self.commandparser = cmdutils.CommandParser()
|
||||||
self.searchparser = cmdutils.SearchParser()
|
self.searchparser = cmdutils.SearchParser()
|
||||||
|
@ -19,18 +19,6 @@
|
|||||||
|
|
||||||
import qutebrowser.config.config as config
|
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):
|
def get_stylesheet(template):
|
||||||
"""Format a stylesheet based on a template.
|
"""Format a stylesheet based on a template.
|
||||||
@ -42,7 +30,8 @@ def get_stylesheet(template):
|
|||||||
The formatted template as string.
|
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):
|
class ColorDict(dict):
|
||||||
|
Loading…
Reference in New Issue
Block a user