X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Futils%2Fconfig.py;fp=sima%2Futils%2Fconfig.py;h=a46c0c66493e3519ab1af41cefe7d88e8087ddbf;hb=d67a78c3f86751a551b370c32aaf3934e772825f;hp=854d6df9cb36adc8213354b1e3b0386a4d45fc80;hpb=24bfc0a6fceb390f4b967be0b83d412dcad44ca5;p=mpd-sima.git diff --git a/sima/utils/config.py b/sima/utils/config.py index 854d6df..a46c0c6 100644 --- a/sima/utils/config.py +++ b/sima/utils/config.py @@ -139,7 +139,7 @@ class ConfMan: # CONFIG MANAGER CLASS self.use_envar() self.startopt = options - ## INIT CALLS + # INIT CALLS self.init_config() self.supersedes_config_with_cmd_line_options() # set dbfile @@ -204,9 +204,11 @@ class ConfMan: # CONFIG MANAGER CLASS # 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"""