Cleanup, more checks

This commit is contained in:
Florian Bruhin 2014-02-13 09:10:53 +01:00
parent 963b90ae74
commit 7deab20820
3 changed files with 19 additions and 19 deletions

View File

@ -20,6 +20,7 @@
from PyQt5.QtCore import pyqtRemoveInputHook from PyQt5.QtCore import pyqtRemoveInputHook
try: try:
# pylint: disable=import-error
from ipdb import set_trace as pdb_set_trace from ipdb import set_trace as pdb_set_trace
except ImportError: except ImportError:
from pdb import set_trace as pdb_set_trace from pdb import set_trace as pdb_set_trace

View File

@ -52,20 +52,7 @@ class CrashDialog(QDialog):
txt = QTextEdit(self) txt = QTextEdit(self)
txt.setReadOnly(True) txt.setReadOnly(True)
outputs = [ txt.setText(self._crash_info(pages, cmdhist, exc))
('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))
vbox.addWidget(txt) vbox.addWidget(txt)
self.setLayout(vbox) self.setLayout(vbox)
@ -83,3 +70,20 @@ class CrashDialog(QDialog):
vbox.addLayout(hbox) vbox.addLayout(hbox)
self.show() 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)

View File

@ -40,9 +40,6 @@ options = {
'target': 'qutebrowser', 'target': 'qutebrowser',
'disable': { 'disable': {
'pylint': [ 'pylint': [
# import seems unreliable
'import-error',
'no-name-in-module',
# short variable names can be nice # short variable names can be nice
'invalid-name', 'invalid-name',
# Basically unavoidable with Qt # Basically unavoidable with Qt
@ -58,8 +55,6 @@ options = {
# I disagree with these # I disagree with these
'star-args', 'star-args',
'fixme', 'fixme',
'too-many-arguments',
'too-many-locals',
'too-many-instance-attributes', 'too-many-instance-attributes',
'global-statement', 'global-statement',
'no-init', 'no-init',