Init message.global_bridge at import time
This commit is contained in:
parent
43a5c46d82
commit
e32bbfa8f7
@ -366,9 +366,6 @@ def _init_modules(args, crash_handler):
|
|||||||
crash_handler: The CrashHandler instance.
|
crash_handler: The CrashHandler instance.
|
||||||
"""
|
"""
|
||||||
# pylint: disable=too-many-statements
|
# pylint: disable=too-many-statements
|
||||||
log.init.debug("Initializing messages...")
|
|
||||||
message.init()
|
|
||||||
|
|
||||||
log.init.debug("Initializing save manager...")
|
log.init.debug("Initializing save manager...")
|
||||||
save_manager = savemanager.SaveManager(qApp)
|
save_manager = savemanager.SaveManager(qApp)
|
||||||
objreg.register('save-manager', save_manager)
|
objreg.register('save-manager', save_manager)
|
||||||
|
@ -30,14 +30,6 @@ from PyQt5.QtWidgets import QApplication
|
|||||||
from qutebrowser.utils import usertypes, log, objreg, utils
|
from qutebrowser.utils import usertypes, log, objreg, utils
|
||||||
|
|
||||||
|
|
||||||
global_bridge = None
|
|
||||||
|
|
||||||
|
|
||||||
def init():
|
|
||||||
global global_bridge
|
|
||||||
global_bridge = GlobalMessageBridge()
|
|
||||||
|
|
||||||
|
|
||||||
def _log_stack(typ, stack):
|
def _log_stack(typ, stack):
|
||||||
"""Log the given message stacktrace.
|
"""Log the given message stacktrace.
|
||||||
|
|
||||||
@ -236,3 +228,6 @@ class MessageBridge(QObject):
|
|||||||
log_stack: ignored
|
log_stack: ignored
|
||||||
"""
|
"""
|
||||||
self.s_question.emit(question, blocking)
|
self.s_question.emit(question, blocking)
|
||||||
|
|
||||||
|
|
||||||
|
global_bridge = GlobalMessageBridge()
|
||||||
|
@ -79,7 +79,6 @@ class MessageMock:
|
|||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def message_mock():
|
def message_mock():
|
||||||
"""Fixture to get a MessageMock."""
|
"""Fixture to get a MessageMock."""
|
||||||
message.init()
|
|
||||||
mmock = MessageMock()
|
mmock = MessageMock()
|
||||||
mmock.patch()
|
mmock.patch()
|
||||||
yield mmock
|
yield mmock
|
||||||
|
Loading…
Reference in New Issue
Block a user