Move SessionManager init to sessions.py.

This commit is contained in:
Florian Bruhin 2015-04-05 23:44:25 +02:00
parent 067ac13018
commit d83da987ae
2 changed files with 11 additions and 2 deletions

View File

@ -187,8 +187,7 @@ class Application(QApplication):
log.init.debug("Initializing crashlog...")
self._handle_segfault()
log.init.debug("Initializing sessions...")
session_manager = sessions.SessionManager(self)
objreg.register('session-manager', session_manager)
sessions.init(self)
log.init.debug("Initializing js-bridge...")
js_bridge = qutescheme.JSBridge(self)
objreg.register('js-bridge', js_bridge)

View File

@ -41,6 +41,16 @@ from qutebrowser.config import config
default = object() # Sentinel value
def init(parent=None):
"""Initialize sessions.
Args:
parent: The parent to use for the SessionManager.
"""
session_manager = SessionManager(parent)
objreg.register('session-manager', session_manager)
class SessionError(Exception):
"""Exception raised when a session failed to load/save."""