X-Git-Url: http://git.kaliko.me/?a=blobdiff_plain;f=sima%2Futils%2Fconfig.py;h=b3a8d46a8c0c9a4d94ed001295226e631eecf61e;hb=325e87e6aaf33974ea8bc8e4b3d2fdbbef56e9a9;hp=e9da8f8f4c245f72b38a27f58f4e97df654c0002;hpb=e8a016a3fef4fffa66312737320451787aa2d2ba;p=mpd-sima.git diff --git a/sima/utils/config.py b/sima/utils/config.py index e9da8f8..b3a8d46 100644 --- a/sima/utils/config.py +++ b/sima/utils/config.py @@ -25,6 +25,7 @@ Parse configuration file and set defaults for missing options. # IMPORTS import configparser +import logging import sys from configparser import Error @@ -105,8 +106,8 @@ class ConfMan(object): # CONFIG MANAGER CLASS * command line options (overrides previous) """ - def __init__(self, logger, options=None): - self.log = logger + def __init__(self, options=None): + self.log = logging.getLogger('sima') # options settings priority: # defauts < env. var. < conf. file < command line self.conf_file = options.get('conf_file') @@ -122,20 +123,6 @@ class ConfMan(object): # CONFIG MANAGER CLASS # generate dbfile self.config['sima']['db_file'] = join(self.config['sima']['var_dir'], 'sima.db') - def get_pw(self): - try: - self.config.getboolean('MPD', 'password') - self.log.debug('No password set, proceeding without ' + - 'authentication...') - return None - except ValueError: - # ValueError if password not a boolean, hence an actual password. - pwd = self.config.get('MPD', 'password') - if not pwd: - self.log.debug('Password set as an empty string.') - return None - return pwd - def control_mod(self): """ Controls conf file permissions.