]> kaliko git repositories - python-musicpd.git/commitdiff
mpd.py: if command retval is None, don't require fetching
authorJ. Alexander Treuman <jat@spatialrift.net>
Tue, 14 Dec 2010 00:47:23 +0000 (19:47 -0500)
committerJ. Alexander Treuman <jat@spatialrift.net>
Tue, 14 Dec 2010 00:47:23 +0000 (19:47 -0500)
mpd.py

diff --git a/mpd.py b/mpd.py
index 05a78297d82a4d477d9ede7eea1d09b21d90f6a8..7305f7d94eba202796d147894c9ecb671cc1381a 100644 (file)
--- a/mpd.py
+++ b/mpd.py
@@ -171,7 +171,9 @@ class MPDClient(object):
             raise CommandListError("Cannot use send_%s in a command list" %
                                    command.replace(" ", "_"))
         self._write_command(command, args)
-        self._pending.append(command)
+        retval = self._commands[command]
+        if retval is not None:
+            self._pending.append(command)
 
     def _fetch(self, command, args=None):
         if self._command_list is not None:
@@ -189,6 +191,7 @@ class MPDClient(object):
         retval = self._commands[command]
         if callable(retval):
             return retval()
+        return retval
 
     def _execute(self, command, args):
         if self._iterating: