Fix some pylint warnings
This commit is contained in:
parent
408fd8a714
commit
973d5d330e
@ -104,7 +104,7 @@ class BaseCurrentPlaylistController(object):
|
||||
tracks = self.playlist.tracks
|
||||
|
||||
assert at_position <= len(tracks), 'at_position can not be greater' \
|
||||
+ ' than playlist length'
|
||||
+ ' than playlist length'
|
||||
|
||||
if at_position is not None:
|
||||
tracks.insert(at_position, track)
|
||||
@ -337,6 +337,8 @@ class BasePlaybackController(object):
|
||||
self._state = self.STOPPED
|
||||
self._shuffled = []
|
||||
self._first_shuffle = True
|
||||
self._play_time_accumulated = 0
|
||||
self._play_time_started = None
|
||||
|
||||
@property
|
||||
def next_track(self):
|
||||
|
||||
@ -36,7 +36,7 @@ class DummyLibraryController(BaseLibraryController):
|
||||
find_exact = search
|
||||
|
||||
class DummyPlaybackController(BasePlaybackController):
|
||||
def _next(self):
|
||||
def _next(self, track):
|
||||
return True
|
||||
|
||||
def _pause(self):
|
||||
@ -45,7 +45,7 @@ class DummyPlaybackController(BasePlaybackController):
|
||||
def _play(self, track):
|
||||
return True
|
||||
|
||||
def _previous(self):
|
||||
def _previous(self, track):
|
||||
return True
|
||||
|
||||
def _resume(self):
|
||||
|
||||
@ -181,6 +181,7 @@ class LibspotifySessionManager(SpotifySessionManager, threading.Thread):
|
||||
self.core_queue = core_queue
|
||||
self.connected = threading.Event()
|
||||
self.audio = AlsaController()
|
||||
self.session = None
|
||||
|
||||
def run(self):
|
||||
self.connect()
|
||||
@ -219,9 +220,11 @@ class LibspotifySessionManager(SpotifySessionManager, threading.Thread):
|
||||
"""Callback used by pyspotify"""
|
||||
logger.debug('Notify main thread')
|
||||
|
||||
def music_delivery(self, *args, **kwargs):
|
||||
def music_delivery(self, session, frames, frame_size, num_frames,
|
||||
sample_type, sample_rate, channels):
|
||||
"""Callback used by pyspotify"""
|
||||
self.audio.music_delivery(*args, **kwargs)
|
||||
self.audio.music_delivery(session, frames, frame_size, num_frames,
|
||||
sample_type, sample_rate, channels)
|
||||
|
||||
def play_token_lost(self, session):
|
||||
"""Callback used by pyspotify"""
|
||||
|
||||
@ -80,6 +80,7 @@ class NadTalker(BaseProcess):
|
||||
def __init__(self, pipe=None):
|
||||
super(NadTalker, self).__init__()
|
||||
self.pipe = pipe
|
||||
self._device = None
|
||||
|
||||
def _run(self):
|
||||
self._open_connection()
|
||||
|
||||
@ -53,6 +53,7 @@ class MpdFrontend(object):
|
||||
def __init__(self, backend=None):
|
||||
self.backend = backend
|
||||
self.command_list = False
|
||||
self.command_list_ok = False
|
||||
|
||||
def handle_request(self, request, add_ok=True):
|
||||
if self.command_list is not False and request != u'command_list_end':
|
||||
@ -286,7 +287,7 @@ class MpdFrontend(object):
|
||||
songpos = int(songpos)
|
||||
track = self.backend.current_playlist.playlist.tracks[songpos]
|
||||
self.backend.current_playlist.remove(track)
|
||||
except IndexError as e:
|
||||
except IndexError:
|
||||
raise MpdAckError(u'Position out of bounds')
|
||||
|
||||
@handle_pattern(r'^deleteid "(?P<songid>\d+)"$')
|
||||
|
||||
@ -67,15 +67,15 @@ class MpdSession(asynchat.async_chat):
|
||||
def found_terminator(self):
|
||||
data = ''.join(self.input_buffer).strip()
|
||||
self.input_buffer = []
|
||||
input = data.decode(ENCODING)
|
||||
logger.debug(u'Input: %s', indent(input))
|
||||
self.handle_request(input)
|
||||
request = data.decode(ENCODING)
|
||||
logger.debug(u'Input: %s', indent(request))
|
||||
self.handle_request(request)
|
||||
|
||||
def handle_request(self, input):
|
||||
def handle_request(self, request):
|
||||
my_end, other_end = multiprocessing.Pipe()
|
||||
self.core_queue.put({
|
||||
'command': 'mpd_request',
|
||||
'request': input,
|
||||
'request': request,
|
||||
'reply_to': pickle_connection(other_end),
|
||||
})
|
||||
my_end.poll(None)
|
||||
|
||||
@ -26,6 +26,8 @@ class CoreProcess(BaseProcess):
|
||||
def __init__(self, core_queue):
|
||||
super(CoreProcess, self).__init__()
|
||||
self.core_queue = core_queue
|
||||
self._backend = None
|
||||
self._frontend = None
|
||||
|
||||
def _run(self):
|
||||
self._setup()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user