From: Kaliko Jack Date: Tue, 17 Jun 2014 14:38:14 +0000 (+0200) Subject: Fixed noidle command X-Git-Tag: v0.4.1 X-Git-Url: http://git.kaliko.me/?p=python-musicpd.git;a=commitdiff_plain;h=28fdb74239a4cc7afc04d500573cb8088b6a083a Fixed noidle command --- diff --git a/CHANGES.txt b/CHANGES.txt index 83a628d..3c097e5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,11 @@ python-musicpd Changes List =========================== +Changes in 0.4.1 +---------------- + +* Fixed noidle command + Changes in 0.4.0 ---------------- diff --git a/musicpd.py b/musicpd.py index 4980c27..118309f 100644 --- a/musicpd.py +++ b/musicpd.py @@ -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") diff --git a/setup.py b/setup.py index 4e49c65..286dafa 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ CLASSIFIERS = [ LICENSE = """\ Copyright (C) 2008-2010 J. Alexander Treuman -Copyright (C) 2012-2013 Kaliko Jack +Copyright (C) 2012-2014 Kaliko Jack 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