summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-04-25 10:46:24 +0200
committerAnton Khirnov <anton@khirnov.net>2013-04-25 10:46:24 +0200
commit56b63e7929bc9a2b74535107e7a9bb5f317bacc1 (patch)
treee7977841d8641f3b0006222879f0f59ac2b9b9f2
parent9fbc47d89b6f696cce2d68caf4509c7d1f222bfe (diff)
mpclient: remove unused get_plist_song()
Also drop now unused synchronous command functions.
-rw-r--r--nephilim/mpclient.py20
-rw-r--r--nephilim/mpdsocket.py31
2 files changed, 0 insertions, 51 deletions
diff --git a/nephilim/mpclient.py b/nephilim/mpclient.py
index 2a454c5..f3fc24a 100644
--- a/nephilim/mpclient.py
+++ b/nephilim/mpclient.py
@@ -206,11 +206,6 @@ class MPClient(QtCore.QObject):
iterator over Songs in current playlist as the argument.
"""
self._command('playlistinfo', callback = lambda data: callback(self._parse_songs(data)))
- def get_plist_song(self, plid):
- """
- Get a song with a given playlist id synchronously.
- """
- return self._command_sync('playlistid', plid, parse = lambda data: Song(list(self._parse_objects(data, []))[0]))
def delete(self, ids):
"""
Delete songs with specified ids from playlist.
@@ -593,21 +588,6 @@ class MPClient(QtCore.QObject):
kwargs['callback']([])
else:
self._socket.write_command(*cmd, **kwargs)
- def _command_sync(self, *cmd, **kwargs):
- """
- Send specified command to MPD synchronously. kwargs must contain
- a callable 'parse' used for parsing the reponse.
- """
- parse = kwargs['parse']
-
- if not self.is_connected():
- self._logger.debug('Not connected -- not running command: %s'%cmd[0])
- return parse([])
- elif not cmd[0] in self._commands:
- self._logger.error('Command %s not allowed.'%cmd[0])
- return parse([])
- else:
- return parse(self._socket.write_command_sync(*cmd))
def _set_output(self, out_id, val):
"""
diff --git a/nephilim/mpdsocket.py b/nephilim/mpdsocket.py
index 685b3d8..7a8f03d 100644
--- a/nephilim/mpdsocket.py
+++ b/nephilim/mpdsocket.py
@@ -126,37 +126,6 @@ class MPDSocket(QtCore.QObject):
for arg in args[1:]:
self._sock.write((' "%s" '%self._escape(unicode(arg))).encode('utf-8'))
self._sock.write('\n')
- def write_command_sync(self, *args):
- """
- Send a command contained in args to MPD synchronously. An iterator over
- response lines is returned.
- """
- # XXX i don't really like this solution. can't it be done better?
- self._logger.debug('Synchronously executing command:' + ' '.join(map(unicode, args)))
- self._sock.blockSignals(True)
- while not self._is_idle:
- # finish all outstanding responses
- if not self._sock.canReadLine():
- self._sock.waitForReadyRead()
- self._handle_response()
-
- self._sock.write('noidle\n')
- self._sock.waitForBytesWritten()
- self._sock.waitForReadyRead()
- self._parse_discard(self._read_response())
-
- self._sock.write(args[0])
- for arg in args[1:]:
- self._sock.write((' "%s" '%self._escape(unicode(arg))).encode('utf-8'))
- self._sock.write('\n')
- self._sock.waitForBytesWritten()
-
- while not self._sock.canReadLine():
- self._sock.waitForReadyRead()
- for line in self._read_response():
- yield line
- self._idle()
- self._sock.blockSignals(False)
def state(self):
"""