diff --git a/qutebrowser/config/websettings.py b/qutebrowser/config/websettings.py index c94b98a1b..a90615d0c 100644 --- a/qutebrowser/config/websettings.py +++ b/qutebrowser/config/websettings.py @@ -24,6 +24,8 @@ Module attributes: settings: The global QWebSettings singleton instance. """ +# pylint: disable=unnecessary-lambda + from PyQt5.QtCore import pyqtSlot from PyQt5.QtWebKit import QWebSettings @@ -98,6 +100,7 @@ STATIC_SETTERS = { lambda v: QWebSettings.setOfflineWebApplicationCacheQuota(v), } + settings = None @@ -126,7 +129,6 @@ def init(cachedir): def on_config_changed(section, option): """Update global settings when qwebsettings changed.""" if section == 'webkit': - settings = QWebSettings.globalSettings() value = config.get(section, option) if option in ATTRIBUTES: settings.setAttribute(ATTRIBUTES[option], value) diff --git a/qutebrowser/utils/url.py b/qutebrowser/utils/url.py index 9fae90094..8edd7d2ab 100644 --- a/qutebrowser/utils/url.py +++ b/qutebrowser/utils/url.py @@ -134,7 +134,6 @@ def fuzzy_url(url): Return: A target QUrl to a searchpage or the original URL. """ - u = qurl(url) urlstr = urlstring(url) if is_url(urlstr): # probably an address diff --git a/qutebrowser/widgets/_tabbedbrowser.py b/qutebrowser/widgets/_tabbedbrowser.py index e32928e65..b797c3328 100644 --- a/qutebrowser/widgets/_tabbedbrowser.py +++ b/qutebrowser/widgets/_tabbedbrowser.py @@ -326,18 +326,23 @@ class TabbedBrowser(TabWidget): self.paste(sel, True) @cmdutils.register(instance='mainwindow.tabs') - def focus_tab(self, arg=None, count=None): - if ((arg is None and count is None) or - (arg is not None and count is not None)): + def focus_tab(self, idx=None, count=None): + """Focus the tab given as argument or in count. + + Args: + idx: The tab index to focus, starting with 1. + """ + if ((idx is None and count is None) or + (idx is not None and count is not None)): message.error("Either argument or count must be given!") return try: - idx = int(arg) if arg is not None else count + i = int(idx) if idx is not None else count except ValueError: - message.error("Invalid argument: {}".format(arg)) + message.error("Invalid argument: {}".format(idx)) return - if 1 <= idx <= self.count(): - self.setCurrentIndex(idx - 1) + if 1 <= i <= self.count(): + self.setCurrentIndex(i - 1) else: message.error("Index out of bounds!") return