X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Futils%2Fconfig.py;h=439f4a57c78bae9c7ca25b0c7dc32a47aafd7b61;hb=78a694ddcd2a6ecc8b2b1fd3c74ee2d938707305;hp=5d79e53a2bbcee6dc34f6fd477f7b79e921f61bf;hpb=3232d76fccc3b431bd42a34a5f182667efa346d0;p=mpd-sima.git diff --git a/sima/utils/config.py b/sima/utils/config.py index 5d79e53..439f4a5 100644 --- a/sima/utils/config.py +++ b/sima/utils/config.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- - -# Copyright (c) 2009, 2010, 2011, 2013 Jack Kaliko +# Copyright (c) 2009, 2010, 2011, 2013, 2014 Jack Kaliko # # This file is part of sima # @@ -36,36 +35,48 @@ from stat import (S_IMODE, ST_MODE, S_IRWXO, S_IRWXG) from . import utils # DEFAULTS -DIRNAME = 'sima' +DIRNAME = 'mpd_sima' CONF_FILE = 'sima.cfg' DEFAULT_CONF = { 'MPD': { 'host': "localhost", #'password': "", - 'port': "6600"}, + 'port': "6600", + }, 'sima': { + 'internal': "Crop, Lastfm, RandomFallBack", + 'contrib': "", 'user_db': "false", 'history_duration': "8", 'queue_length': "1", - 'consume': "0",}, + }, 'daemon':{ 'daemon': "false", - 'pidfile': "",}, + 'pidfile': "", + }, 'log': { 'verbosity': "info", - 'logfile': "",}, + 'logfile': "", + }, + 'echonest': { + 'queue_mode': "track", #TODO control values + 'max_art': "15", + 'single_album': "false", + 'track_to_add': "1", + 'album_to_add': "1", + 'depth': "1", + }, 'lastfm': { - 'dynamic': "10", - 'similarity': "20", 'queue_mode': "track", #TODO control values + 'max_art': "10", 'single_album': "false", 'track_to_add': "1", 'album_to_add': "1", 'depth': "1", }, 'randomfallback': { - 'flavour': "sensible", # in pure, sensible, genre + 'flavour': "sensible", # in pure, sensible 'track_to_add': "1", } } @@ -115,11 +126,11 @@ class ConfMan(object): # CONFIG MANAGER CLASS return None except ValueError: # ValueError if password not a boolean, hence an actual password. - pw = self.config.get('MPD', 'password') - if not pw: + pwd = self.config.get('MPD', 'password') + if not pwd: self.log.debug('Password set as an empty string.') return None - return pw + return pwd def control_mod(self): """ @@ -178,8 +189,8 @@ class ConfMan(object): # CONFIG MANAGER CLASS self.log.debug('[%s] present in conf file' % section) for option in self.defaults[section]: if self.config.has_option(section, option): - #self.log.debug(u'option "%s" set to "%s" in conf. file' % - # (option, self.config.get(section, option))) + #self.log.debug('option "%s" set to "%s" in conf. file'% + # (option, self.config.get(section, option))) pass else: self.log.debug(