You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
commands() returns commands which are not available #101
The documentation for commands() states that it returns "commands the current user has access to." However, after initiating an MPDClient object, I get several commands which have not been bound yet or do not exist at all.
from mpd import MPDClient
mpc = MPDClient()
mpc.connect('127.0.0.1', port=6600)
for c in filter(lambda x: x not in dir(mpc), mpc.commands()):
print(c)
In python-mpd2 there is sticker_get(), sticker_delete() and sticker_set() instead of a sticker function. The function unmount is spelled in incorrectly in the library:
Aaaah, I see. So basically commands() just lists the commands that the server makes available to clients, not necessarily commands that are available through python-mpd2.
Activity
Mic92 commentedon Oct 25, 2018
Can you do connect with netcat and then type
commands?Mic92 commentedon Oct 25, 2018
What is the output of:
It my version it look as expected.
RealFerdinandDeSaussure commentedon Oct 25, 2018
Using netcat, the server returns those three commands as well (sticker, unmount, volume).
But they don't appear when using dir.
Thanks for the lightning fast reply btw.
Mic92 commentedon Oct 26, 2018
The following code shows the correct result:
RealFerdinandDeSaussure commentedon Nov 6, 2018
Yes, that shows me what commands are available. But shouldn't mpc.commands() do that as well?
Mic92 commentedon Nov 6, 2018
Your code was not correct. Using
setis also faster (also this probably does not matter here).RealFerdinandDeSaussure commentedon Nov 6, 2018
I don't understand. Isn't
commands()supposed to list all available commands? Because right now, it lists some that are not available.As you can see, this list includes among others
sticker,unmountandvolume.Yet:
Mic92 commentedon Nov 6, 2018
In python-mpd2 there is
sticker_get(),sticker_delete()andsticker_set()instead of astickerfunction. The functionunmountis spelled in incorrectly in the library:python-mpd2/mpd/base.py
Line 309 in d9860f4
volumewas deprecated at some point by mpd and removed from this library: https://github.com/Mic92/python-mpd2/blob/master/doc/changes.rst#changes-in-041RealFerdinandDeSaussure commentedon Nov 17, 2018
Aaaah, I see. So basically commands() just lists the commands that the server makes available to clients, not necessarily commands that are available through python-mpd2.