From 8d781c68c940b02d46ed9b80a4226e73b9ceaf29 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 10 Nov 2016 21:23:09 +0100 Subject: [PATCH] Fix lint --- qutebrowser/browser/webengine/certificateerror.py | 3 ++- qutebrowser/browser/webengine/webview.py | 6 ++++-- scripts/dev/run_vulture.py | 1 + tests/end2end/fixtures/quteprocess.py | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/qutebrowser/browser/webengine/certificateerror.py b/qutebrowser/browser/webengine/certificateerror.py index b9d254c7f..19b59c522 100644 --- a/qutebrowser/browser/webengine/certificateerror.py +++ b/qutebrowser/browser/webengine/certificateerror.py @@ -19,8 +19,9 @@ """Wrapper over a QWebEngineCertificateError.""" - +# pylint: disable=no-name-in-module,import-error,useless-suppression from PyQt5.QtWebEngineWidgets import QWebEngineCertificateError +# pylint: enable=no-name-in-module,import-error,useless-suppression from qutebrowser.utils import usertypes, utils, debug diff --git a/qutebrowser/browser/webengine/webview.py b/qutebrowser/browser/webengine/webview.py index 4e3617b8a..a1e19f37d 100644 --- a/qutebrowser/browser/webengine/webview.py +++ b/qutebrowser/browser/webengine/webview.py @@ -132,7 +132,8 @@ class WebEnginePage(QWebEnginePage): QWebEnginePage.Geolocation: ('content', 'geolocation'), QWebEnginePage.MediaAudioCapture: ('content', 'media-capture'), QWebEnginePage.MediaVideoCapture: ('content', 'media-capture'), - QWebEnginePage.MediaAudioVideoCapture: ('content', 'media-capture'), + QWebEnginePage.MediaAudioVideoCapture: + ('content', 'media-capture'), } messages = { QWebEnginePage.Geolocation: 'access your location', @@ -232,7 +233,8 @@ class WebEnginePage(QWebEnginePage): # WORKAROUND # Can't override javaScriptPrompt with older PyQt versions # https://www.riverbankcomputing.com/pipermail/pyqt/2016-November/038293.html - def javaScriptPrompt(self, url, js_msg, default, result): + def javaScriptPrompt(self, url, js_msg, default): + """Override javaScriptPrompt to use qutebrowser prompts.""" if self._is_shutting_down: return (False, "") try: diff --git a/scripts/dev/run_vulture.py b/scripts/dev/run_vulture.py index 3d8fa7e17..ade05ac94 100755 --- a/scripts/dev/run_vulture.py +++ b/scripts/dev/run_vulture.py @@ -98,6 +98,7 @@ def whitelist_generator(): yield 'scripts.dev.pylint_checkers.config.' + attr yield 'scripts.dev.pylint_checkers.modeline.process_module' + yield 'scripts.dev.pylint_checkers.qute_pylint.config.msgs' for attr in ['_get_default_metavar_for_optional', '_get_default_metavar_for_positional', '_metavar_formatter']: diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index 4db75e55b..53f3bee88 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -235,7 +235,8 @@ class QuteProc(testprocess.Process): except testprocess.InvalidLine: if not line.strip(): return None - elif is_ignored_qt_message(line) or is_ignored_lowlevel_message(line): + elif (is_ignored_qt_message(line) or + is_ignored_lowlevel_message(line)): return None else: raise