expand '~' in host in mpdstats

This commit is contained in:
Johann Klähn 2013-12-11 12:04:39 +01:00
parent 15b6433db0
commit 97e4ccbbd9

View file

@ -64,6 +64,10 @@ class Client(object):
"""
host = config['mpd']['host'].get(unicode)
port = config['mpd']['port'].get(int)
if host[0] in ['/', '~']:
host = os.path.expanduser(host)
log.info(u'mpdstats: connecting to {0}:{1}'.format(host, port))
try:
self.client.connect(host, port)