]> kaliko git repositories - python-musicpd.git/commitdiff
Fixed noidle command v0.4.1
authorKaliko Jack <kaliko@azylum.org>
Tue, 17 Jun 2014 14:38:14 +0000 (16:38 +0200)
committerKaliko Jack <kaliko@azylum.org>
Tue, 17 Jun 2014 14:38:14 +0000 (16:38 +0200)
CHANGES.txt
musicpd.py
setup.py

index 83a628df6453329f0926d9cea0473e7ca87a2b00..3c097e5ca7fdcfaac6d0c75f63d65e88f0b574e9 100644 (file)
@@ -1,6 +1,11 @@
 python-musicpd Changes List
 ===========================
 
+Changes in 0.4.1
+----------------
+
+* Fixed noidle command
+
 Changes in 0.4.0
 ----------------
 
index 4980c270c641eda68993982db11b074ac14e1faa..118309f351402ae6c1ed8d7df56aae97d878842c 100644 (file)
@@ -24,7 +24,7 @@ HELLO_PREFIX = "OK MPD "
 ERROR_PREFIX = "ACK "
 SUCCESS = "OK"
 NEXT = "list_OK"
-VERSION = '0.4.0'
+VERSION = '0.4.1'
 
 
 class MPDError(Exception):
@@ -90,7 +90,7 @@ class MPDClient:
             "clearerror":         self._fetch_nothing,
             "currentsong":        self._fetch_object,
             "idle":               self._fetch_list,
-            "noidle":             None,
+            #"noidle":             None,
             "status":             self._fetch_object,
             "stats":              self._fetch_object,
             # Playback Option Commands
@@ -457,6 +457,14 @@ class MPDClient:
         else:
             raise ConnectionError("getaddrinfo returns an empty list")
 
+    def noidle(self):
+        # noidle's special case
+        if not self._pending or self._pending[0] != 'idle':
+            raise CommandError('cannot send noidle if send_idle was not called')
+        del self._pending[0]
+        self._write_command("noidle")
+        return self._fetch_list()
+
     def connect(self, host, port):
         if self._sock is not None:
             raise ConnectionError("Already connected")
index 4e49c650ad74d842a5c17d09bf3af76be340c52d..286dafa8fbeb462c25bfd5bb1437547544e7960e 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@ CLASSIFIERS = [
 
 LICENSE = """\
 Copyright (C) 2008-2010  J. Alexander Treuman <jat@spatialrift.net>
-Copyright (C) 2012-2013  Kaliko Jack <kaliko@azylum.org>
+Copyright (C) 2012-2014  Kaliko Jack <kaliko@azylum.org>
 
 python-musicpd is free software: you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by