Permalink
Browse files

Fix lint

  • Loading branch information...
The-Compiler committed Aug 9, 2016
1 parent 2cbb147 commit fb3da578c56b3b33aaee4cd8d92a5767995cfcdc
@@ -1185,14 +1185,13 @@ def bookmark_del(self, url=None):
current page's url.
"""
if url is None:
- url = self._current_url().toString(QUrl.RemovePassword
- | QUrl.FullyEncoded)
+ url = self._current_url().toString(QUrl.RemovePassword |
+ QUrl.FullyEncoded)
try:
objreg.get('bookmark-manager').delete(url)
except KeyError:
raise cmdexc.CommandError("Bookmark '{}' not found!".format(url))
-
@cmdutils.register(instance='command-dispatcher', hide=True,
scope='window')
def follow_selected(self, *, tab=False):
@@ -761,7 +761,7 @@ def start(self, rapid=False, group=webelem.Group.all, target=Target.normal,
only_visible=True)
def current_mode(self):
- """Returns the currently active hinting mode (or None otherwise)."""
+ """Return the currently active hinting mode (or None otherwise)."""
if self._context is None:
return None
@@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
-"""Implementation of :navigate"""
+"""Implementation of :navigate."""
import posixpath
@@ -36,22 +36,30 @@
class Attribute(websettings.Attribute):
+ """A setting set via QWebEngineSettings::setAttribute."""
+
GLOBAL_SETTINGS = QWebEngineSettings.globalSettings
ENUM_BASE = QWebEngineSettings
class Setter(websettings.Setter):
+ """A setting set via QWebEngineSettings getter/setter methods."""
+
GLOBAL_SETTINGS = QWebEngineSettings.globalSettings
class NullStringSetter(websettings.NullStringSetter):
+ """A setter for settings requiring a null QString as default."""
+
GLOBAL_SETTINGS = QWebEngineSettings.globalSettings
class StaticSetter(websettings.StaticSetter):
+ """A setting set via static QWebEngineSettings getter/setter methods."""
+
GLOBAL_SETTINGS = QWebEngineSettings.globalSettings
@@ -34,22 +34,30 @@
class Attribute(websettings.Attribute):
+ """A setting set via QWebSettings::setAttribute."""
+
GLOBAL_SETTINGS = QWebSettings.globalSettings
ENUM_BASE = QWebSettings
class Setter(websettings.Setter):
+ """A setting set via QWebSettings getter/setter methods."""
+
GLOBAL_SETTINGS = QWebSettings.globalSettings
class NullStringSetter(websettings.NullStringSetter):
+ """A setter for settings requiring a null QString as default."""
+
GLOBAL_SETTINGS = QWebSettings.globalSettings
class StaticSetter(websettings.StaticSetter):
+ """A setting set via static QWebSettings getter/setter methods."""
+
GLOBAL_SETTINGS = QWebSettings.globalSettings
@@ -1270,7 +1270,7 @@ def data(readonly=False):
"Font used in the completion widget."),
('completion.category',
- SettingValue(typ.Font(), 'bold ${completion}'),
+ SettingValue(typ.Font(), 'bold ${completion}'),
"Font used in the completion categories."),
('tabbar',
@@ -125,11 +125,11 @@ def __init__(self, none_ok=False):
self.valid_values = None
def get_name(self):
- """Get a name for the type for documentation"""
+ """Get a name for the type for documentation."""
return self.__class__.__name__
def get_valid_values(self):
- """Get the type's valid values for documentation"""
+ """Get the type's valid values for documentation."""
return self.valid_values
def _basic_validation(self, value):
@@ -60,11 +60,11 @@ def _missing_str(name, *, windows=None, pip=None, webengine=False):
blocks.append('<br />'.join(lines))
if webengine:
lines = [
- 'Note QtWebEngine is not available for some distributions '
+ ('Note QtWebEngine is not available for some distributions '
'(like Debian/Ubuntu), so you need to start without '
- '--backend webengine there.',
- 'QtWebEngine is currently unsupported with the OS X .app, see '
- 'https://github.com/The-Compiler/qutebrowser/issues/1692',
+ '--backend webengine there.'),
+ ('QtWebEngine is currently unsupported with the OS X .app, see '
+ 'https://github.com/The-Compiler/qutebrowser/issues/1692'),
]
else:
lines = ['<b>If you installed a qutebrowser package for your '
@@ -77,6 +77,7 @@ def download_open(quteproc):
cmd = '{} -c pass'.format(shlex.quote(sys.executable))
quteproc.send_cmd(':download-open {}'.format(cmd))
+
@bdd.when("I directly open the download")
def download_open_with_prompt(quteproc):
cmd = '{} -c pass'.format(shlex.quote(sys.executable))
@@ -26,6 +26,7 @@
import pytest
+
@pytest.mark.parametrize('cmd', [':quit', ':later 500 quit'])
def test_smoke(cmd, capfd):
if hasattr(sys, 'frozen'):
@@ -221,6 +221,7 @@ def test_selectors(self, webframe, group, val, matching):
elems = [e for e in elems if filterfunc(e)]
assert bool(elems) == matching
+
class TestWebKitElement:
"""Generic tests for WebKitElement.
@@ -96,30 +96,30 @@ def cmdutils_patch(monkeypatch, stubs):
@cmdutils.argument('option', completion=usertypes.Completion.option)
@cmdutils.argument('value', completion=usertypes.Completion.value)
def set_command(section_=None, option=None, value=None):
- """docstring!"""
+ """docstring."""
pass
@cmdutils.argument('topic', completion=usertypes.Completion.helptopic)
def show_help(tab=False, bg=False, window=False, topic=None):
- """docstring!"""
+ """docstring."""
pass
@cmdutils.argument('url', completion=usertypes.Completion.url)
@cmdutils.argument('count', count=True)
def openurl(url=None, implicit=False, bg=False, tab=False, window=False,
count=None):
- """docstring!"""
+ """docstring."""
pass
@cmdutils.argument('win_id', win_id=True)
@cmdutils.argument('command', completion=usertypes.Completion.command)
def bind(key, win_id, command=None, *, mode='normal', force=False):
- """docstring!"""
+ """docstring."""
# pylint: disable=unused-variable
pass
def tab_detach():
- """docstring!"""
+ """docstring."""
pass
cmds = {
@@ -59,6 +59,7 @@ def _extract_model_data(model):
data.append(row)
return data
+
@pytest.mark.parametrize('pattern, data, expected', [
('foo', 'barfoobar', True),
('foo', 'barFOObar', True),
@@ -283,7 +283,7 @@ def test_default_config_no_deprecated(self, rgx):
('download-remove --all', 'download-clear'),
('hint links fill ":open {hint-url}"',
- 'hint links fill :open {hint-url}'),
+ 'hint links fill :open {hint-url}'),
('hint links fill ":open -t {hint-url}"',
'hint links fill :open -t {hint-url}'),

0 comments on commit fb3da57

Please sign in to comment.