Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Compiler committed Aug 9, 2016
1 parent 2cbb147 commit fb3da57
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 18 deletions.
5 changes: 2 additions & 3 deletions qutebrowser/browser/commands.py
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion qutebrowser/browser/hints.py
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion qutebrowser/browser/navigate.py
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions qutebrowser/browser/webengine/webenginesettings.py
Expand Up @@ -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


Expand Down
8 changes: 8 additions & 0 deletions qutebrowser/browser/webkit/webkitsettings.py
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion qutebrowser/config/configdata.py
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions qutebrowser/config/configtypes.py
Expand Up @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions qutebrowser/misc/earlyinit.py
Expand Up @@ -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 '
Expand Down
1 change: 1 addition & 0 deletions tests/end2end/features/test_downloads_bdd.py
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions tests/end2end/test_smoke.py
Expand Up @@ -26,6 +26,7 @@

import pytest


@pytest.mark.parametrize('cmd', [':quit', ':later 500 quit'])
def test_smoke(cmd, capfd):
if hasattr(sys, 'frozen'):
Expand Down
1 change: 1 addition & 0 deletions tests/unit/browser/webkit/test_webkitelem.py
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/completion/test_completer.py
Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions tests/unit/completion/test_sortfilter.py
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/config/test_config.py
Expand Up @@ -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}'),
Expand Down

0 comments on commit fb3da57

Please sign in to comment.