sys.exit(1)
-def get_mpd_environ():#{{{
- """
- Retrieve MPD env. var.
- """
- con_id = dict({'host': 'localhost',
- 'port': int(6600)})
- passwd = None
- mpd_host_env = environ.get('MPD_HOST')
- if mpd_host_env:
- # If password is set:
- # mpd_host_env = ['pass', 'host'] because MPD_HOST=pass@host
- mpd_host_env = mpd_host_env.split('@')
- mpd_host_env.reverse()
- con_id.update({'host': mpd_host_env[0]})
- if len(mpd_host_env) > 1:
- print 'passwd set in MPD_HOST'
- passwd = mpd_host_env[1]
-
- con_id.update({'port': int(environ.get('MPD_PORT', con_id.get('port')))})
- return (con_id, passwd)#}}}
-
-
class MPDClass(object):
"""Connect to MPD server
"""
def mpdConnect(self, con_id):#{{{
"""
Simple wrapper to connect MPD.
+ con_id = {'host': 'MPD_server', 'port': 'MPD_server port'}
"""
try:
self.client.connect(**con_id)
return False
return True#}}}
- def connect(self):
- """Connect & auth"""
- pass
def main():
pass