Move exit logging to app.py for Python2 compatibility.
This commit is contained in:
parent
35e8a44049
commit
f5ecba0d07
@ -43,7 +43,7 @@ from qutebrowser.browser import quickmarks, cookies, downloads, cache
|
|||||||
from qutebrowser.widgets import mainwindow, console, crash
|
from qutebrowser.widgets import mainwindow, console, crash
|
||||||
from qutebrowser.keyinput import modeparsers, keyparser, modeman
|
from qutebrowser.keyinput import modeparsers, keyparser, modeman
|
||||||
from qutebrowser.utils import (log, version, message, utilcmds, readline,
|
from qutebrowser.utils import (log, version, message, utilcmds, readline,
|
||||||
utils, qtutils, urlutils)
|
utils, qtutils, urlutils, debug)
|
||||||
from qutebrowser.utils import usertypes as utypes
|
from qutebrowser.utils import usertypes as utypes
|
||||||
|
|
||||||
|
|
||||||
@ -767,4 +767,7 @@ class Application(QApplication):
|
|||||||
def exit(self, status):
|
def exit(self, status):
|
||||||
"""Extend QApplication::exit to log the event."""
|
"""Extend QApplication::exit to log the event."""
|
||||||
log.destroy.debug("Now calling QApplication::exit.")
|
log.destroy.debug("Now calling QApplication::exit.")
|
||||||
|
if self.args.debug_exit:
|
||||||
|
print("Now logging late shutdown.", file=sys.stderr)
|
||||||
|
debug.trace_lines(True)
|
||||||
super().exit(status)
|
super().exit(status)
|
||||||
|
@ -116,7 +116,6 @@ def main():
|
|||||||
earlyinit.check_pygments()
|
earlyinit.check_pygments()
|
||||||
# We do this import late as we need to fix harfbuzz first.
|
# We do this import late as we need to fix harfbuzz first.
|
||||||
from qutebrowser import app
|
from qutebrowser import app
|
||||||
from qutebrowser.utils import debug
|
|
||||||
from PyQt5.QtCore import pyqtRemoveInputHook
|
from PyQt5.QtCore import pyqtRemoveInputHook
|
||||||
import PyQt5.QtWidgets as QtWidgets
|
import PyQt5.QtWidgets as QtWidgets
|
||||||
# We don't use qutebrowser via the interactive shell, but we want to be
|
# We don't use qutebrowser via the interactive shell, but we want to be
|
||||||
@ -131,8 +130,5 @@ def main():
|
|||||||
# FIXME: We should do another attempt at contacting upstream about this.
|
# FIXME: We should do another attempt at contacting upstream about this.
|
||||||
QtWidgets.qApp = app
|
QtWidgets.qApp = app
|
||||||
ret = app.exec_()
|
ret = app.exec_()
|
||||||
if args.debug_exit:
|
|
||||||
print("Now logging late shutdown.", file=sys.stderr)
|
|
||||||
debug.trace_lines(True)
|
|
||||||
QtWidgets.qApp = None
|
QtWidgets.qApp = None
|
||||||
return ret
|
return ret
|
||||||
|
Loading…
Reference in New Issue
Block a user