diff --git a/qutebrowser/utils/misc.py b/qutebrowser/utils/misc.py index ef2e4d817..e31b71002 100644 --- a/qutebrowser/utils/misc.py +++ b/qutebrowser/utils/misc.py @@ -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 diff --git a/qutebrowser/widgets/crash.py b/qutebrowser/widgets/crash.py index 8c4110c9b..57c2582a2 100644 --- a/qutebrowser/widgets/crash.py +++ b/qutebrowser/widgets/crash.py @@ -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) diff --git a/run_checks.py b/run_checks.py index e9448e982..f3280f545 100644 --- a/run_checks.py +++ b/run_checks.py @@ -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',