]> kaliko git repositories - python-musicpd.git/blobdiff - musicpd.py
mpd_version attribute init to empty string instead of None
[python-musicpd.git] / musicpd.py
index 87bcaca0980b33b8e27a5e380b340bbec392ce85..50c35dd33bdd80342f38b230f674e399a5445f13 100644 (file)
@@ -1,9 +1,9 @@
-# SPDX-FileCopyrightText: 2012-2022  kaliko <kaliko@azylum.org>
+# SPDX-FileCopyrightText: 2012-2023  kaliko <kaliko@azylum.org>
 # SPDX-FileCopyrightText: 2021       Wonko der Verständige <wonko@hanstool.org>
 # SPDX-FileCopyrightText: 2019       Naglis Jonaitis <naglis@mailbox.org>
 # SPDX-FileCopyrightText: 2019       Bart Van Loon <bbb@bbbart.be>
 # SPDX-FileCopyrightText: 2008-2010  J. Alexander Treuman <jat@spatialrift.net>
-# SPDX-License-Identifier: GPL-3.0-or-later
+# SPDX-License-Identifier: LGPL-3.0-or-later
 """python-musicpd: Python Music Player Daemon client library"""
 
 
@@ -16,7 +16,7 @@ HELLO_PREFIX = "OK MPD "
 ERROR_PREFIX = "ACK "
 SUCCESS = "OK"
 NEXT = "list_OK"
-VERSION = '0.8.0'
+VERSION = '0.9.0b0'
 #: Seconds before a connection attempt times out
 #: (overriden by MPD_TIMEOUT env. var.)
 CONNECTION_TIMEOUT = 30
@@ -152,6 +152,10 @@ class MPDClient:
         #: Current connection timeout value, defaults to
         #: :py:obj:`CONNECTION_TIMEOUT` or env. var. ``MPD_TIMEOUT`` if provided
         self.mpd_timeout = None
+        self.mpd_version = ''
+        """Protocol version as exposed by the server as a :py:obj:`str`
+
+        .. note:: This is the version of the protocol spoken, not the real version of the daemon."""
         self._reset()
         self._commands = {
             # Status Commands
@@ -585,7 +589,7 @@ class MPDClient:
         self.mpd_version = line[len(HELLO_PREFIX):].strip()
 
     def _reset(self):
-        self.mpd_version = None
+        self.mpd_version = ''
         self._iterating = False
         self._pending = []
         self._command_list = None