diff --git a/mopidy/frontends/mpd/dispatcher.py b/mopidy/frontends/mpd/dispatcher.py index 65346275..996c3714 100644 --- a/mopidy/frontends/mpd/dispatcher.py +++ b/mopidy/frontends/mpd/dispatcher.py @@ -7,7 +7,7 @@ from pykka.registry import ActorRegistry from mopidy import settings from mopidy.backends.base import Backend from mopidy.frontends.mpd.exceptions import (MpdAckError, MpdArgError, - MpdPermissionError, MpdPasswordError, MpdSystemError, MpdUnknownCommand) + MpdPermissionError, MpdSystemError, MpdUnknownCommand) from mopidy.frontends.mpd.protocol import mpd_commands, request_handlers # Do not remove the following import. The protocol modules must be imported to # get them registered as request handlers. @@ -74,7 +74,8 @@ class MpdDispatcher(object): return self._call_next_filter(request, response, filter_chain) else: command = request.split(' ')[0] - if command in ('close', 'commands', 'notcommands', 'password', 'ping'): + if command in ( + 'close', 'commands', 'notcommands', 'password', 'ping'): return self._call_next_filter(request, response, filter_chain) else: raise MpdPermissionError(command=command) @@ -142,7 +143,7 @@ class MpdDispatcher(object): def _format_response(self, response): formatted_response = [] for element in self._listify_result(response): - formatted_response.extend(self._format_lines(element)) + formatted_response.extend(self._format_lines(element)) return formatted_response def _listify_result(self, result): diff --git a/mopidy/frontends/mpd/protocol/command_list.py b/mopidy/frontends/mpd/protocol/command_list.py index a8a0c317..f2c51578 100644 --- a/mopidy/frontends/mpd/protocol/command_list.py +++ b/mopidy/frontends/mpd/protocol/command_list.py @@ -36,7 +36,8 @@ def command_list_end(context): response = context.dispatcher.handle_request( command, current_command_list_index=index) command_list_response.extend(response) - if command_list_response and command_list_response[-1].startswith(u'ACK'): + if (command_list_response and + command_list_response[-1].startswith(u'ACK')): return command_list_response if command_list_ok: command_list_response.append(u'list_OK') diff --git a/mopidy/frontends/mpd/server.py b/mopidy/frontends/mpd/server.py index a2d9cefe..4e651ddb 100644 --- a/mopidy/frontends/mpd/server.py +++ b/mopidy/frontends/mpd/server.py @@ -52,7 +52,8 @@ class MpdServer(asyncore.dispatcher): self._format_hostname(settings.MPD_SERVER_HOSTNAME), settings.MPD_SERVER_PORT) except IOError, e: - logger.error(u'MPD server startup failed: %s' % str(e).decode('utf-8')) + logger.error(u'MPD server startup failed: %s' % + str(e).decode('utf-8')) sys.exit(1) def handle_accept(self): diff --git a/mopidy/frontends/mpd/session.py b/mopidy/frontends/mpd/session.py index 5a86dfdb..53f4cab7 100644 --- a/mopidy/frontends/mpd/session.py +++ b/mopidy/frontends/mpd/session.py @@ -1,7 +1,6 @@ import asynchat import logging -from mopidy import settings from mopidy.frontends.mpd.dispatcher import MpdDispatcher from mopidy.frontends.mpd.protocol import ENCODING, LINE_TERMINATOR, VERSION from mopidy.utils.log import indent @@ -46,7 +45,10 @@ class MpdSession(asynchat.async_chat): return self.dispatcher.handle_request(request) def send_response(self, response): - """Format a response from the MPD command handlers and send it to the client.""" + """ + Format a response from the MPD command handlers and send it to the + client. + """ if response is not None: response = LINE_TERMINATOR.join(response) logger.debug(u'Response to [%s]:%s: %s', self.client_address,