X-Git-Url: http://git.kaliko.me/?p=python-musicpd.git;a=blobdiff_plain;f=musicpd.py;fp=musicpd.py;h=35be751a0587960fd2c92ab470b3ee8ed4158119;hp=7d0918c9e0f33277835452aab1509b4b9967dc00;hb=c3bb82643e556ce0e7c53ca9aab276c3c963bcfc;hpb=11078491b9ccbafa03d5070309aeb89a195e9bc0 diff --git a/musicpd.py b/musicpd.py index 7d0918c..35be751 100644 --- a/musicpd.py +++ b/musicpd.py @@ -302,16 +302,20 @@ class MPDClient: "readmessages": self._fetch_messages, "sendmessage": self._fetch_nothing, } + #: host used with the current connection (:py:obj:`str`) + self.host = None + #: password detected in :envvar:`MPD_HOST` environment variable (:py:obj:`str`) + self.pwd = None + #: port used with the current connection (:py:obj:`int`, :py:obj:`str`) + self.port = None self._get_envvars() def _get_envvars(self): """ - Retrieve MPD env. var. to overrides "localhost:6600" - Use MPD_HOST/MPD_PORT if set - else use MPD_HOST=${XDG_RUNTIME_DIR:-/run/}/mpd/socket if file exists + Retrieve MPD env. var. to overrides default "localhost:6600" """ + # Set some defaults self.host = 'localhost' - self.pwd = None self.port = os.getenv('MPD_PORT', '6600') _host = os.getenv('MPD_HOST', '') if _host: