Fix Python 3.4 circular imports
This commit is contained in:
parent
9db4a8cb43
commit
91cd6c6288
@ -28,9 +28,9 @@ from PyQt5.QtCore import pyqtSignal, pyqtSlot, QObject, QUrl
|
|||||||
|
|
||||||
from qutebrowser.config import configdata, configexc, configtypes, configfiles
|
from qutebrowser.config import configdata, configexc, configtypes, configfiles
|
||||||
from qutebrowser.utils import (utils, objreg, message, standarddir, log,
|
from qutebrowser.utils import (utils, objreg, message, standarddir, log,
|
||||||
usertypes, jinja)
|
usertypes)
|
||||||
from qutebrowser.misc import objects
|
from qutebrowser.misc import objects
|
||||||
from qutebrowser.commands import cmdexc, cmdutils, runners
|
from qutebrowser.commands import cmdexc, cmdutils
|
||||||
|
|
||||||
|
|
||||||
# An easy way to access the config from other code via config.val.foo
|
# An easy way to access the config from other code via config.val.foo
|
||||||
@ -174,6 +174,8 @@ class KeyConfig:
|
|||||||
|
|
||||||
def bind(self, key, command, *, mode, force=False, save_yaml=False):
|
def bind(self, key, command, *, mode, force=False, save_yaml=False):
|
||||||
"""Add a new binding from key to command."""
|
"""Add a new binding from key to command."""
|
||||||
|
# Doing this here to work around a Python 3.4 circular import
|
||||||
|
from qutebrowser.commands import runners
|
||||||
key = self._prepare(key, mode)
|
key = self._prepare(key, mode)
|
||||||
|
|
||||||
parser = runners.CommandParser()
|
parser = runners.CommandParser()
|
||||||
@ -574,6 +576,8 @@ class StyleSheetObserver(QObject):
|
|||||||
Return:
|
Return:
|
||||||
The formatted template as string.
|
The formatted template as string.
|
||||||
"""
|
"""
|
||||||
|
# Imported here to avoid a Python 3.4 circular import
|
||||||
|
from qutebrowser.utils import jinja
|
||||||
template = jinja.environment.from_string(self._stylesheet)
|
template = jinja.environment.from_string(self._stylesheet)
|
||||||
return template.render(conf=val)
|
return template.render(conf=val)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user