self.use_envar()
self.startopt = options
- ## INIT CALLS
+ # INIT CALLS
self.init_config()
self.supersedes_config_with_cmd_line_options()
# set dbfile
# honor MPD_HOST format as in mpc(1) for command line option --host
if self.startopt.get('host'):
if '@' in self.startopt.get('host'):
- passwd, host = self.startopt.get('host').split('@')
- self.config.set('MPD', 'password', passwd)
- self.config.set('MPD', 'host', host)
+ host, passwd = utils.parse_mpd_host(self.startopt.get('host'))
+ if passwd:
+ self.config.set('MPD', 'password', passwd)
+ if host:
+ self.config.set('MPD', 'host', host)
def use_envar(self):
"""Use MPD en.var. to set defaults"""