From e184ace8cb19effac80f196f54d4df445d9f503f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 30 Nov 2018 08:55:15 +0100 Subject: [PATCH] Fix lint --- qutebrowser/browser/browsertab.py | 3 ++- qutebrowser/browser/webengine/webenginetab.py | 6 ++++-- qutebrowser/browser/webkit/webkittab.py | 10 +++++----- qutebrowser/config/configtypes.py | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/qutebrowser/browser/browsertab.py b/qutebrowser/browser/browsertab.py index 885d5d3f9..4bffbb796 100644 --- a/qutebrowser/browser/browsertab.py +++ b/qutebrowser/browser/browsertab.py @@ -685,7 +685,7 @@ class AbstractElements: def find_css(self, selector: str, callback: _MultiCallback, - error_callback: _ErrorCallback, *, + error_cb: _ErrorCallback, *, only_visible: bool = False) -> None: """Find all HTML elements matching a given selector async. @@ -694,6 +694,7 @@ class AbstractElements: Args: callback: The callback to be called when the search finished. + error_cb: The callback to be called when an error occurred. selector: The CSS selector to search for. only_visible: Only show elements which are visible on screen. """ diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index cf1649ed6..a74d866ea 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -24,8 +24,8 @@ import functools import re import html as html_utils -from PyQt5.QtCore import (pyqtSignal, pyqtSlot, Qt, QEvent, QPoint, QPointF, - QUrl, QTimer, QObject) +from PyQt5.QtCore import (pyqtSignal, pyqtSlot, Qt, QPoint, QPointF, QUrl, + QTimer, QObject) from PyQt5.QtGui import QIcon from PyQt5.QtNetwork import QAuthenticator from PyQt5.QtWidgets import QApplication @@ -520,6 +520,8 @@ class WebEngineScroller(browsertab.AbstractScroller): class WebEngineHistoryPrivate(browsertab.AbstractHistoryPrivate): + """History-related methods which are not part of the extension API.""" + def serialize(self): if not qtutils.version_check('5.9', compiled=False): # WORKAROUND for diff --git a/qutebrowser/browser/webkit/webkittab.py b/qutebrowser/browser/webkit/webkittab.py index d0ff650b5..c10c2aeec 100644 --- a/qutebrowser/browser/webkit/webkittab.py +++ b/qutebrowser/browser/webkit/webkittab.py @@ -23,8 +23,7 @@ import re import functools import xml.etree.ElementTree -from PyQt5.QtCore import (pyqtSlot, Qt, QEvent, QUrl, QPoint, QTimer, QSizeF, - QSize) +from PyQt5.QtCore import pyqtSlot, Qt, QUrl, QPoint, QTimer, QSizeF, QSize from PyQt5.QtGui import QIcon from PyQt5.QtWebKitWidgets import QWebPage, QWebFrame from PyQt5.QtWebKit import QWebSettings @@ -511,6 +510,8 @@ class WebKitScroller(browsertab.AbstractScroller): class WebKitHistoryPrivate(browsertab.AbstractHistoryPrivate): + """History-related methods which are not part of the extension API.""" + def serialize(self): return qtutils.serialize(self._history) @@ -600,8 +601,7 @@ class WebKitElements(browsertab.AbstractElements): # Escape non-alphanumeric characters in the selector # https://www.w3.org/TR/CSS2/syndata.html#value-def-identifier elem_id = re.sub(r'[^a-zA-Z0-9_-]', r'\\\g<0>', elem_id) - self.find_css('#' + elem_id, find_id_cb, - error_callback=lambda exc: None) + self.find_css('#' + elem_id, find_id_cb, error_cb=lambda exc: None) def find_focused(self, callback): frame = self._widget.page().currentFrame() @@ -727,7 +727,7 @@ class WebKitTab(browsertab.AbstractTab): url, emit_before_load_started=emit_before_load_started) self._widget.load(url) - def url(self, requested=False): + def url(self, *, requested=False): frame = self._widget.page().mainFrame() if requested: return frame.requestedUrl() diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index c0f3bec9f..d4ce33d21 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -923,7 +923,7 @@ class IgnoreCase(MappingType): ('always', "Search case-insensitively."), ('never', "Search case-sensitively."), ('smart', ("Search case-sensitively if there are capital " - "characters.")))), + "characters.")))) MAPPING = { 'always': usertypes.IgnoreCase.always,