[Pkg-mpd-commits] [python-mpd] 97/262: README.txt show how to add/remove commands

Simon McVittie smcv at debian.org
Sun May 22 18:16:30 UTC 2016


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch upstream
in repository python-mpd.

commit e9dacb5e52854531daee32d2e3b74d960b872c3f
Author: Jörg Thalheim <jthalheim at gmail.com>
Date:   Thu Feb 16 15:47:33 2012 +0100

    README.txt show how to add/remove commands
---
 README.txt | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/README.txt b/README.txt
index 899b1e3..f10db8a 100644
--- a/README.txt
+++ b/README.txt
@@ -77,6 +77,20 @@ client.send_idle()
 events = client.fetch_idle()
 ------------------------------------------------------------------------------
 
+*Future Compatible*
+New commands or special handling of commands can be easily implemented.
+Use `add_command()` or `remove_command()` to modify the commands of the
+MPDClient class and all its instances.
+
+------------------------------------------------------------------------------
+def fetch_cover(client):
+    """"Take a MPDClient instance as its arguments and return mimetype and image"""
+    # this command may come in the future.
+    pass
+self.client.add_command("get_cover", fetch_cover)
+# remove the command, because it doesn't exist already.
+self.client.remove_command("get_cover")
+------------------------------------------------------------------------------
 
 Contacting the author
 ---------------------

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mpd/python-mpd.git



More information about the Pkg-mpd-commits mailing list