Cleanup, more checks
This commit is contained in:
parent
963b90ae74
commit
7deab20820
@ -20,6 +20,7 @@
|
||||
from PyQt5.QtCore import pyqtRemoveInputHook
|
||||
|
||||
try:
|
||||
# pylint: disable=import-error
|
||||
from ipdb import set_trace as pdb_set_trace
|
||||
except ImportError:
|
||||
from pdb import set_trace as pdb_set_trace
|
||||
|
@ -52,20 +52,7 @@ class CrashDialog(QDialog):
|
||||
|
||||
txt = QTextEdit(self)
|
||||
txt.setReadOnly(True)
|
||||
outputs = [
|
||||
('Version info', version()),
|
||||
('Exception', ''.join(traceback.format_exception(*exc))),
|
||||
('Open Pages', '\n'.join(pages)),
|
||||
('Command history', '\n'.join(cmdhist)),
|
||||
('Commandline args', ' '.join(sys.argv[1:])),
|
||||
('Config', config.config.dump_userconfig()),
|
||||
]
|
||||
chunks = []
|
||||
for (header, body) in outputs:
|
||||
h = '==== {} ===='.format(header)
|
||||
chunks.append('\n'.join([h, body]))
|
||||
|
||||
txt.setText('\n\n'.join(chunks))
|
||||
txt.setText(self._crash_info(pages, cmdhist, exc))
|
||||
vbox.addWidget(txt)
|
||||
self.setLayout(vbox)
|
||||
|
||||
@ -83,3 +70,20 @@ class CrashDialog(QDialog):
|
||||
|
||||
vbox.addLayout(hbox)
|
||||
self.show()
|
||||
|
||||
def _crash_info(self, pages, cmdhist, exc):
|
||||
"""Gather crash information to display."""
|
||||
outputs = [
|
||||
('Version info', version()),
|
||||
('Exception', ''.join(traceback.format_exception(*exc))),
|
||||
('Open Pages', '\n'.join(pages)),
|
||||
('Command history', '\n'.join(cmdhist)),
|
||||
('Commandline args', ' '.join(sys.argv[1:])),
|
||||
('Config', config.config.dump_userconfig()),
|
||||
]
|
||||
chunks = []
|
||||
for (header, body) in outputs:
|
||||
h = '==== {} ===='.format(header)
|
||||
chunks.append('\n'.join([h, body]))
|
||||
|
||||
return '\n\n'.join(chunks)
|
||||
|
@ -40,9 +40,6 @@ options = {
|
||||
'target': 'qutebrowser',
|
||||
'disable': {
|
||||
'pylint': [
|
||||
# import seems unreliable
|
||||
'import-error',
|
||||
'no-name-in-module',
|
||||
# short variable names can be nice
|
||||
'invalid-name',
|
||||
# Basically unavoidable with Qt
|
||||
@ -58,8 +55,6 @@ options = {
|
||||
# I disagree with these
|
||||
'star-args',
|
||||
'fixme',
|
||||
'too-many-arguments',
|
||||
'too-many-locals',
|
||||
'too-many-instance-attributes',
|
||||
'global-statement',
|
||||
'no-init',
|
||||
|
Loading…
Reference in New Issue
Block a user