Mic92 / python-mpd2

Python library which provides a client interface for the Music Player Daemon.
GNU Lesser General Public License v3.0
353 stars 119 forks source link

priorid command seems not work (my mpd version 0.16.7) #1

Closed handsomegui closed 12 years ago

handsomegui commented 12 years ago

In [10]: c.priorid(200, '24')

CommandError Traceback (most recent call last) /home/honey/ in () ----> 1 c.priorid(200, '24')

/usr/lib/python2.7/site-packages/python_mpd2-0.4.0-py2.7.egg/mpd.pyc in decorator(self, args) 476 def newFunction(wrapper, name, returnValue): 477 def decorator(self, args): --> 478 return wrapper(self, name, args, bound_decorator(self, returnValue)) 479 return decorator 480

/usr/lib/python2.7/site-packages/python_mpd2-0.4.0-py2.7.egg/mpd.pyc in _execute(self, command, args, retval) 202 self._write_command(command, args) 203 if isinstance(retval, Callable): --> 204 return retval() 205 return retval 206

/usr/lib/python2.7/site-packages/python_mpd2-0.4.0-py2.7.egg/mpd.pyc in decorator(_args, _kwargs) 471 """ bind decorator to self """ 472 def decorator(_args, _kwargs): --> 473 return function(self, _args, *_kwargs) 474 return decorator 475

/usr/lib/python2.7/site-packages/python_mpd2-0.4.0-py2.7.egg/mpd.pyc in _fetch_nothing(self) 301 302 def _fetch_nothing(self): --> 303 line = self._read_line() 304 if line is not None: 305 raise ProtocolError("Got unexpected return value: '%s'" % line)

/usr/lib/python2.7/site-packages/python_mpd2-0.4.0-py2.7.egg/mpd.pyc in _read_line(self) 222 if line.startswith(ERROR_PREFIX): 223 error = line[len(ERROR_PREFIX):].strip() --> 224 raise CommandError(error) 225 if self._command_list is not None: 226 if line == NEXT:

CommandError: [5@0] {} unknown command "priorid"

Mic92 commented 12 years ago

Sorry, this is a bad typo of mine. It must be "prioid" not "priorid". But this is not the hole story. mpd v0.16.7 doesn't support this command. It will be avaible in mpd v0.17 when it's released. So you have to use the git version of mpd to benefit from it. Just look it up like this:

"prioid" in c.commands() # returns True, if avaible
Mic92 commented 12 years ago

I also add a test to prevent such errors in the future!

handsomegui commented 12 years ago

Very nice. Thanks for the work you have done. Keep going!

handsomegui commented 12 years ago

Pls also check the doc/commands.txt file. Line 47, 48. It it correct? Otherwise it might be misleading for users.

Mic92 commented 12 years ago

done.

handsomegui commented 12 years ago

Good job. Finally a great python biding of MPD out there!