Import keyconf at file scope again in config.py
Various code (like src2asciidoc.py) relies on all @cmdutils.register decorators being called when qutebrowser.app is imported. Moving the keyconf import to _init_key_config broke that assumption, as keyconf isn't imported anywhere anymore - which caused :bind and :unbind to vanish from the generated documentation. In the long run we should perhaps use venusian: http://docs.pylonsproject.org/projects/venusian/ But for now, this is the easiest solution.
This commit is contained in:
parent
7c5d0eea44
commit
bf29c2a753
@ -36,6 +36,7 @@ import collections.abc
|
||||
from PyQt5.QtCore import pyqtSignal, QObject, QUrl, QSettings
|
||||
|
||||
from qutebrowser.config import configdata, configexc, textwrapper
|
||||
from qutebrowser.config.parsers import keyconf
|
||||
from qutebrowser.config.parsers import ini
|
||||
from qutebrowser.commands import cmdexc, cmdutils
|
||||
from qutebrowser.utils import (message, objreg, utils, standarddir, log,
|
||||
@ -178,7 +179,6 @@ def _init_key_config(parent):
|
||||
Args:
|
||||
parent: The parent to use for the KeyConfigParser.
|
||||
"""
|
||||
from qutebrowser.config.parsers import keyconf
|
||||
args = objreg.get('args')
|
||||
try:
|
||||
key_config = keyconf.KeyConfigParser(standarddir.config(), 'keys.conf',
|
||||
|
@ -25,7 +25,7 @@ import itertools
|
||||
|
||||
from PyQt5.QtCore import pyqtSignal, QObject
|
||||
|
||||
from qutebrowser.config import configdata, textwrapper, config
|
||||
from qutebrowser.config import configdata, textwrapper
|
||||
from qutebrowser.commands import cmdutils, cmdexc
|
||||
from qutebrowser.utils import log, utils, qtutils, message, usertypes
|
||||
|
||||
@ -335,6 +335,7 @@ class KeyConfigParser(QObject):
|
||||
|
||||
def _validate_command(self, line):
|
||||
"""Check if a given command is valid."""
|
||||
from qutebrowser.config import config
|
||||
if line == self.UNBOUND_COMMAND:
|
||||
return
|
||||
commands = line.split(';;')
|
||||
|
Loading…
Reference in New Issue
Block a user