X-Git-Url: http://git.kaliko.me/?p=python-musicpd.git;a=blobdiff_plain;f=mpd.py;h=5973a39b34c5580b3a885e67a232c76b5649d8fd;hp=7f610759d6cb516203511068da869ca2066a1cf0;hb=756f8629e87886799fbbb7467ce022613cf56ac9;hpb=b38fd7af26788bb6c81235733209bbeb0391abc8 diff --git a/mpd.py b/mpd.py index 7f61075..5973a39 100644 --- a/mpd.py +++ b/mpd.py @@ -1,18 +1,18 @@ -# Python MPD client library +# python-mpd: Python MPD client library # Copyright (C) 2008-2010 J. Alexander Treuman # -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by +# python-mpd is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# This program is distributed in the hope that it will be useful, +# python-mpd is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# GNU Lesser General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# You should have received a copy of the GNU Lesser General Public License +# along with python-mpd. If not, see . import socket @@ -67,6 +67,8 @@ class MPDClient(object): # Playback Option Commands "consume": self._fetch_nothing, "crossfade": self._fetch_nothing, + "mixrampdb": self._fetch_nothing, + "mixrampdelay": self._fetch_nothing, "random": self._fetch_nothing, "repeat": self._fetch_nothing, "setvol": self._fetch_nothing, @@ -114,12 +116,14 @@ class MPDClient(object): # Database Commands "count": self._fetch_object, "find": self._fetch_songs, + "findadd": self._fetch_nothing, "list": self._fetch_list, "listall": self._fetch_database, "listallinfo": self._fetch_database, "lsinfo": self._fetch_database, "search": self._fetch_songs, "update": self._fetch_item, + "rescan": self._fetch_item, # Sticker Commands "sticker get": self._fetch_item, "sticker set": self._fetch_nothing, @@ -140,6 +144,7 @@ class MPDClient(object): "notcommands": self._fetch_list, "tagtypes": self._fetch_list, "urlhandlers": self._fetch_list, + "decoders": self._fetch_plugins, } def __getattr__(self, attr): @@ -152,10 +157,11 @@ class MPDClient(object): else: command = attr wrapper = self._execute - command = command.replace("_", " ") if command not in self._commands: - raise AttributeError("'%s' object has no attribute '%s'" % - (self.__class__.__name__, attr)) + command = command.replace("_", " ") + if command not in self._commands: + raise AttributeError("'%s' object has no attribute '%s'" % + (self.__class__.__name__, attr)) return lambda *args: wrapper(command, args) def _send(self, command, args): @@ -323,6 +329,9 @@ class MPDClient(object): def _fetch_objects(self, delimiters): return self._wrap_iterator(self._read_objects(delimiters)) + def _fetch_changes(self): + return self._fetch_objects(["cpos"]) + def _fetch_songs(self): return self._fetch_objects(["file"]) @@ -335,8 +344,8 @@ class MPDClient(object): def _fetch_outputs(self): return self._fetch_objects(["outputid"]) - def _fetch_changes(self): - return self._fetch_objects(["cpos"]) + def _fetch_plugins(self): + return self._fetch_objects(["plugin"]) def _fetch_command_list(self): return self._wrap_iterator(self._read_command_list())