Merge pull request #986 from ali/fix/flake8

Fix flake8 tests
This commit is contained in:
Stein Magnus Jodal 2015-02-16 10:33:21 +01:00
commit 6d92e97c7c
3 changed files with 6 additions and 6 deletions

View File

@ -98,8 +98,8 @@ class Core(
# We ignore cases when target state is set as this is buffering
# updates (at least for now) and we need to get #234 fixed...
if (new_state == PlaybackState.PAUSED and not target_state
and self.playback.state != PlaybackState.PAUSED):
if (new_state == PlaybackState.PAUSED and not target_state and
self.playback.state != PlaybackState.PAUSED):
self.playback.state = new_state
self.playback._trigger_track_playback_paused()

View File

@ -392,8 +392,8 @@ class TracklistController(object):
criteria = criteria or kwargs
matches = self._tl_tracks
for (key, values) in criteria.items():
if (not isinstance(values, collections.Iterable)
or isinstance(values, compat.string_types)):
if (not isinstance(values, collections.Iterable) or
isinstance(values, compat.string_types)):
# Fail hard if anyone is using the <0.17 calling style
raise ValueError('Filter values must be iterable: %r' % values)
if key == 'tlid':

View File

@ -124,8 +124,8 @@ def search(tracks, query=None, uris=None):
return bool(t.name and q in t.name.lower())
def album_filter(t):
return bool(t.album and t.album.name
and q in t.album.name.lower())
return bool(t.album and t.album.name and
q in t.album.name.lower())
def artist_filter(t):
return bool(filter(lambda a: