New flake8 version with new checks to conform to
This commit is contained in:
parent
9db9def367
commit
5583ca5aba
@ -38,7 +38,7 @@ _proxy_schema['username'] = String(optional=True)
|
||||
_proxy_schema['password'] = Secret(optional=True)
|
||||
|
||||
# NOTE: if multiple outputs ever comes something like LogLevelConfigSchema
|
||||
#_outputs_schema = config.AudioOutputConfigSchema()
|
||||
# _outputs_schema = config.AudioOutputConfigSchema()
|
||||
|
||||
_schemas = [_logging_schema, _loglevels_schema, _audio_schema, _proxy_schema]
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ class PlaybackController(object):
|
||||
uri_scheme = urlparse.urlparse(uri).scheme
|
||||
return self.backends.with_playback.get(uri_scheme, None)
|
||||
|
||||
### Properties
|
||||
# Properties
|
||||
|
||||
def get_current_tl_track(self):
|
||||
return self.current_tl_track
|
||||
@ -127,7 +127,7 @@ class PlaybackController(object):
|
||||
mute = property(get_mute, set_mute)
|
||||
"""Mute state as a :class:`True` if muted, :class:`False` otherwise"""
|
||||
|
||||
### Methods
|
||||
# Methods
|
||||
|
||||
def change_track(self, tl_track, on_error_step=1):
|
||||
"""
|
||||
|
||||
@ -23,7 +23,7 @@ class TracklistController(object):
|
||||
|
||||
self._shuffled = []
|
||||
|
||||
### Properties
|
||||
# Properties
|
||||
|
||||
def get_tl_tracks(self):
|
||||
return self._tl_tracks[:]
|
||||
@ -136,7 +136,7 @@ class TracklistController(object):
|
||||
Playback continues after current song.
|
||||
"""
|
||||
|
||||
### Methods
|
||||
# Methods
|
||||
|
||||
def index(self, tl_track):
|
||||
"""
|
||||
|
||||
@ -68,7 +68,7 @@ class MpdDispatcher(object):
|
||||
else:
|
||||
return response
|
||||
|
||||
### Filter: catch MPD ACK errors
|
||||
# Filter: catch MPD ACK errors
|
||||
|
||||
def _catch_mpd_ack_errors_filter(self, request, response, filter_chain):
|
||||
try:
|
||||
@ -78,7 +78,7 @@ class MpdDispatcher(object):
|
||||
mpd_ack_error.index = self.command_list_index
|
||||
return [mpd_ack_error.get_mpd_ack()]
|
||||
|
||||
### Filter: authenticate
|
||||
# Filter: authenticate
|
||||
|
||||
def _authenticate_filter(self, request, response, filter_chain):
|
||||
if self.authenticated:
|
||||
@ -94,7 +94,7 @@ class MpdDispatcher(object):
|
||||
else:
|
||||
raise exceptions.MpdPermissionError(command=command_name)
|
||||
|
||||
### Filter: command list
|
||||
# Filter: command list
|
||||
|
||||
def _command_list_filter(self, request, response, filter_chain):
|
||||
if self._is_receiving_command_list(request):
|
||||
@ -117,7 +117,7 @@ class MpdDispatcher(object):
|
||||
self.command_list_index is not None and
|
||||
request != 'command_list_end')
|
||||
|
||||
### Filter: idle
|
||||
# Filter: idle
|
||||
|
||||
def _idle_filter(self, request, response, filter_chain):
|
||||
if self._is_currently_idle() and not self._noidle.match(request):
|
||||
@ -140,7 +140,7 @@ class MpdDispatcher(object):
|
||||
def _is_currently_idle(self):
|
||||
return bool(self.context.subscriptions)
|
||||
|
||||
### Filter: add OK
|
||||
# Filter: add OK
|
||||
|
||||
def _add_ok_filter(self, request, response, filter_chain):
|
||||
response = self._call_next_filter(request, response, filter_chain)
|
||||
@ -151,7 +151,7 @@ class MpdDispatcher(object):
|
||||
def _has_error(self, response):
|
||||
return response and response[-1].startswith('ACK')
|
||||
|
||||
### Filter: call handler
|
||||
# Filter: call handler
|
||||
|
||||
def _call_handler_filter(self, request, response, filter_chain):
|
||||
try:
|
||||
|
||||
@ -34,7 +34,7 @@ def enableoutput(context, outputid):
|
||||
|
||||
|
||||
# TODO: implement and test
|
||||
#@protocol.commands.add('toggleoutput', outputid=protocol.UINT)
|
||||
# @protocol.commands.add('toggleoutput', outputid=protocol.UINT)
|
||||
def toggleoutput(context, outputid):
|
||||
"""
|
||||
*musicpd.org, audio output section:*
|
||||
|
||||
@ -360,8 +360,8 @@ def swapid(context, tlid1, tlid2):
|
||||
|
||||
|
||||
# TODO: add at least reflection tests before adding NotImplemented version
|
||||
#@protocol.commands.add(
|
||||
# 'prio', priority=protocol.UINT, position=protocol.RANGE)
|
||||
# @protocol.commands.add(
|
||||
# 'prio', priority=protocol.UINT, position=protocol.RANGE)
|
||||
def prio(context, priority, position):
|
||||
"""
|
||||
*musicpd.org, current playlist section:*
|
||||
@ -378,7 +378,7 @@ def prio(context, priority, position):
|
||||
|
||||
|
||||
# TODO: add at least reflection tests before adding NotImplemented version
|
||||
#@protocol.commands.add('prioid')
|
||||
# @protocol.commands.add('prioid')
|
||||
def prioid(context, *args):
|
||||
"""
|
||||
*musicpd.org, current playlist section:*
|
||||
@ -391,7 +391,7 @@ def prioid(context, *args):
|
||||
|
||||
|
||||
# TODO: add at least reflection tests before adding NotImplemented version
|
||||
#@protocol.commands.add('addtagid', tlid=protocol.UINT)
|
||||
# @protocol.commands.add('addtagid', tlid=protocol.UINT)
|
||||
def addtagid(context, tlid, tag, value):
|
||||
"""
|
||||
*musicpd.org, current playlist section:*
|
||||
@ -407,7 +407,7 @@ def addtagid(context, tlid, tag, value):
|
||||
|
||||
|
||||
# TODO: add at least reflection tests before adding NotImplemented version
|
||||
#@protocol.commands.add('cleartagid', tlid=protocol.UINT)
|
||||
# @protocol.commands.add('cleartagid', tlid=protocol.UINT)
|
||||
def cleartagid(context, tlid, tag):
|
||||
"""
|
||||
*musicpd.org, current playlist section:*
|
||||
|
||||
@ -550,7 +550,7 @@ def update(context, uri=None):
|
||||
|
||||
|
||||
# TODO: add at least reflection tests before adding NotImplemented version
|
||||
#@protocol.commands.add('readcomments')
|
||||
# @protocol.commands.add('readcomments')
|
||||
def readcomments(context, uri):
|
||||
"""
|
||||
*musicpd.org, music database section:*
|
||||
|
||||
@ -33,7 +33,7 @@ def crossfade(context, seconds):
|
||||
|
||||
|
||||
# TODO: add at least reflection tests before adding NotImplemented version
|
||||
#@protocol.commands.add('mixrampdb')
|
||||
# @protocol.commands.add('mixrampdb')
|
||||
def mixrampdb(context, decibels):
|
||||
"""
|
||||
*musicpd.org, playback section:*
|
||||
@ -50,7 +50,7 @@ def mixrampdb(context, decibels):
|
||||
|
||||
|
||||
# TODO: add at least reflection tests before adding NotImplemented version
|
||||
#@protocol.commands.add('mixrampdelay', seconds=protocol.UINT)
|
||||
# @protocol.commands.add('mixrampdelay', seconds=protocol.UINT)
|
||||
def mixrampdelay(context, seconds):
|
||||
"""
|
||||
*musicpd.org, playback section:*
|
||||
|
||||
@ -155,13 +155,13 @@ class JsonRpcWrapper(object):
|
||||
if not isinstance(request, dict):
|
||||
raise JsonRpcInvalidRequestError(
|
||||
data='Request must be an object')
|
||||
if not 'jsonrpc' in request:
|
||||
if 'jsonrpc' not in request:
|
||||
raise JsonRpcInvalidRequestError(
|
||||
data='"jsonrpc" member must be included')
|
||||
if request['jsonrpc'] != '2.0':
|
||||
raise JsonRpcInvalidRequestError(
|
||||
data='"jsonrpc" value must be "2.0"')
|
||||
if not 'method' in request:
|
||||
if 'method' not in request:
|
||||
raise JsonRpcInvalidRequestError(
|
||||
data='"method" member must be included')
|
||||
if not isinstance(request['method'], unicode):
|
||||
@ -169,7 +169,7 @@ class JsonRpcWrapper(object):
|
||||
data='"method" must be a string')
|
||||
|
||||
def _get_params(self, request):
|
||||
if not 'params' in request:
|
||||
if 'params' not in request:
|
||||
return [], {}
|
||||
params = request['params']
|
||||
if isinstance(params, list):
|
||||
|
||||
@ -154,7 +154,7 @@ class AudioStateTest(unittest.TestCase):
|
||||
self.audio._on_playbin_state_changed(
|
||||
gst.STATE_PAUSED, gst.STATE_READY, gst.STATE_NULL)
|
||||
# We never get the following call, so the logic must work without it
|
||||
#self.audio._on_playbin_state_changed(
|
||||
# gst.STATE_READY, gst.STATE_NULL, gst.STATE_VOID_PENDING)
|
||||
# self.audio._on_playbin_state_changed(
|
||||
# gst.STATE_READY, gst.STATE_NULL, gst.STATE_VOID_PENDING)
|
||||
|
||||
self.assertEqual(audio.PlaybackState.STOPPED, self.audio.state)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#encoding: utf-8
|
||||
# encoding: utf-8
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
@ -559,7 +559,7 @@ class MusicDatabaseListTest(protocol.BaseTestCase):
|
||||
self.sendRequest('list "foo"')
|
||||
self.assertEqualResponse('ACK [2@0] {list} incorrect arguments')
|
||||
|
||||
### Artist
|
||||
# Artist
|
||||
|
||||
def test_list_artist_with_quotes(self):
|
||||
self.sendRequest('list "artist"')
|
||||
@ -619,7 +619,7 @@ class MusicDatabaseListTest(protocol.BaseTestCase):
|
||||
self.assertNotInResponse('Artist: ')
|
||||
self.assertInResponse('OK')
|
||||
|
||||
### Albumartist
|
||||
# Albumartist
|
||||
|
||||
def test_list_albumartist_with_quotes(self):
|
||||
self.sendRequest('list "albumartist"')
|
||||
@ -682,7 +682,7 @@ class MusicDatabaseListTest(protocol.BaseTestCase):
|
||||
self.assertNotInResponse('Performer: ')
|
||||
self.assertInResponse('OK')
|
||||
|
||||
### Composer
|
||||
# Composer
|
||||
|
||||
def test_list_composer_with_quotes(self):
|
||||
self.sendRequest('list "composer"')
|
||||
@ -745,7 +745,7 @@ class MusicDatabaseListTest(protocol.BaseTestCase):
|
||||
self.assertNotInResponse('Performer: ')
|
||||
self.assertInResponse('OK')
|
||||
|
||||
### Performer
|
||||
# Performer
|
||||
|
||||
def test_list_performer_with_quotes(self):
|
||||
self.sendRequest('list "performer"')
|
||||
@ -808,7 +808,7 @@ class MusicDatabaseListTest(protocol.BaseTestCase):
|
||||
self.assertNotInResponse('Performer: ')
|
||||
self.assertInResponse('OK')
|
||||
|
||||
### Album
|
||||
# Album
|
||||
|
||||
def test_list_album_with_quotes(self):
|
||||
self.sendRequest('list "album"')
|
||||
@ -879,7 +879,7 @@ class MusicDatabaseListTest(protocol.BaseTestCase):
|
||||
self.assertNotInResponse('Album: ')
|
||||
self.assertInResponse('OK')
|
||||
|
||||
### Date
|
||||
# Date
|
||||
|
||||
def test_list_date_with_quotes(self):
|
||||
self.sendRequest('list "date"')
|
||||
@ -934,7 +934,7 @@ class MusicDatabaseListTest(protocol.BaseTestCase):
|
||||
self.assertNotInResponse('Date: ')
|
||||
self.assertInResponse('OK')
|
||||
|
||||
### Genre
|
||||
# Genre
|
||||
|
||||
def test_list_genre_with_quotes(self):
|
||||
self.sendRequest('list "genre"')
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#encoding: utf-8
|
||||
# encoding: utf-8
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#encoding: utf-8
|
||||
# encoding: utf-8
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
@ -13,7 +13,8 @@ class TrackMpdFormatTest(unittest.TestCase):
|
||||
uri='a uri',
|
||||
artists=[Artist(name='an artist')],
|
||||
name='a name',
|
||||
album=Album(name='an album', num_tracks=13,
|
||||
album=Album(
|
||||
name='an album', num_tracks=13,
|
||||
artists=[Artist(name='an other artist')]),
|
||||
track_no=7,
|
||||
composers=[Artist(name='a composer')],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user