[Pkg-mpd-commits] [python-mpd] 217/262: adding readcomments command

Simon McVittie smcv at debian.org
Sun May 22 18:16:49 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 1f08af520a07ac6b60ee6958982ef6ea849f828f
Author: Jörg Thalheim <joerg at higgsboson.tk>
Date:   Sat Nov 2 12:10:06 2013 +0100

    adding readcomments command
---
 doc/changes.rst         | 4 ++++
 doc/topics/commands.rst | 1 +
 mpd.py                  | 1 +
 setup.py                | 1 -
 test.py                 | 8 ++++++++
 5 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/doc/changes.rst b/doc/changes.rst
index 2cd2e37..33a940f 100644
--- a/doc/changes.rst
+++ b/doc/changes.rst
@@ -1,6 +1,10 @@
 python-mpd2 Changes List
 ========================
 
+Changes in v0.5.2
+-----------------
+* add support for readcomments
+
 Changes in v0.5.1
 -----------------
 * add support for ranges
diff --git a/doc/topics/commands.rst b/doc/topics/commands.rst
index b6bf5c7..cb49826 100644
--- a/doc/topics/commands.rst
+++ b/doc/topics/commands.rst
@@ -97,6 +97,7 @@ list         <str> [<locate>]  fetch_list
 listall      [<str>]           fetch_database
 listallinfo  [<str>]           fetch_database
 lsinfo       [<str>]           fetch_database
+readcomments <str>             fetch_object
 search       <locate>          fetch_songs
 searchadd    <locate>          fetch_songs
 searchaddpl  <str> <locate>    fetch_songs
diff --git a/mpd.py b/mpd.py
index 54873fc..9f8cf51 100644
--- a/mpd.py
+++ b/mpd.py
@@ -142,6 +142,7 @@ _commands = {
     "listall":            "_fetch_database",
     "listallinfo":        "_fetch_database",
     "lsinfo":             "_fetch_database",
+    "readcomments":       "_fetch_object",
     "search":             "_fetch_songs",
     "searchadd":          "_fetch_nothing",
     "searchaddpl":        "_fetch_nothing",
diff --git a/setup.py b/setup.py
index a56756b..01f3107 100644
--- a/setup.py
+++ b/setup.py
@@ -69,5 +69,4 @@ setup(
     cmdclass = {'test': Tox},
 )
 
-
 # vim: set expandtab shiftwidth=4 softtabstop=4 textwidth=79:
diff --git a/test.py b/test.py
index 3d6d894..9b4dc83 100755
--- a/test.py
+++ b/test.py
@@ -139,6 +139,14 @@ class TestMPDClient(unittest.TestCase):
         self.assertEqual(1, self.client._wfile.write.call_count)
         self.assertEqual({'volume': '50'}, status)
 
+    def test_readcomments(self):
+        self.MPDWillReturn("major_brand: M4V\n", "minor_version: 1\n", "lyrics: Lalala\n", "OK\n")
+        comments = self.client.readcomments()
+        self.assertMPDReceived('readcomments\n')
+        self.assertEqual(comments['major_brand'], "M4V")
+        self.assertEqual(comments['minor_version'], "1")
+        self.assertEqual(comments['lyrics'], "Lalala")
+
     def test_iterating(self):
         self.MPDWillReturn("file: my-song.ogg\n", "Pos: 0\n", "Id: 66\n", "OK\n")
         self.client.iterate = True

-- 
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