@protocol.commands.add(u'command_list_end', list_command=False)
def command_list_end(context):
 if (not context.dispatcher.command_list_receiving):
  raise exceptions.MpdUnknownCommand(command=u'command_list_end')
 context.dispatcher.command_list_receiving = False
 (command_list, context.dispatcher.command_list) = (context.dispatcher.command_list, [])
 (command_list_ok, context.dispatcher.command_list_ok) = (context.dispatcher.command_list_ok, False)
 command_list_response = []
 for (index, command) in enumerate(command_list):
  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')):
   return command_list_response
  if command_list_ok:
   command_list_response.append(u'list_OK')
 return command_list_response

@ protocol . commands . add ( u'command_list_end' , list_command = False ) def command_list_end ( context ) : if ( not context . dispatcher . command_list_receiving ) : raise exceptions . MpdUnknownCommand ( command = u'command_list_end' ) context . dispatcher . command_list_receiving = False ( command_list , context . dispatcher . command_list ) = ( context . dispatcher . command_list , [ ] ) ( command_list_ok , context . dispatcher . command_list_ok ) = ( context . dispatcher . command_list_ok , False ) command_list_response = [ ] for ( index , command ) in enumerate ( command_list ) : 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' ) ) : return command_list_response if command_list_ok : command_list_response . append ( u'list_OK' ) return command_list_response
see :meth:command_list_begin() .