Fix problems reported by pylint

This commit is contained in:
Jakub Klinkovský 2016-02-05 17:13:14 +01:00 committed by Florian Bruhin
parent 1b32444256
commit de66b68b75

View File

@ -725,7 +725,7 @@ class HintManager(QObject):
keyparser.update_bindings(strings, preserve_filter=True) keyparser.update_bindings(strings, preserve_filter=True)
def _filter_matches(self, filterstr, elemstr): def _filter_matches(self, filterstr, elemstr):
"""Returns True if `filterstr` matches `elemstr`.""" """Return True if `filterstr` matches `elemstr`."""
# Empty string and None always match # Empty string and None always match
if not filterstr: if not filterstr:
return True return True
@ -899,10 +899,10 @@ class HintManager(QObject):
"""Filter displayed hints according to a text. """Filter displayed hints according to a text.
Args: Args:
filterstr: The string to filter with, or None to use the filter from filterstr: The string to filter with, or None to use the filter
previous call (saved in `self._filterstr`). If `filterstr` from previous call (saved in `self._filterstr`). If
is an empty string or if both `filterstr` and `filterstr` is an empty string or if both `filterstr`
`self._filterstr` are None, all hints are shown. and `self._filterstr` are None, all hints are shown.
""" """
if filterstr is None: if filterstr is None:
filterstr = self._filterstr filterstr = self._filterstr
@ -932,7 +932,8 @@ class HintManager(QObject):
pass pass
if not elems: if not elems:
# Whoops, filtered all hints # Whoops, filtered all hints
modeman.leave(self._win_id, usertypes.KeyMode.hint, 'all filtered') modeman.leave(self._win_id, usertypes.KeyMode.hint,
'all filtered')
return return
self._update_strings(elems) self._update_strings(elems)
visible = self._context.elems visible = self._context.elems
@ -946,7 +947,8 @@ class HintManager(QObject):
pass pass
if not visible: if not visible:
# Whoops, filtered all hints # Whoops, filtered all hints
modeman.leave(self._win_id, usertypes.KeyMode.hint, 'all filtered') modeman.leave(self._win_id, usertypes.KeyMode.hint,
'all filtered')
return return
if (len(visible) == 1 and if (len(visible) == 1 and