]> kaliko git repositories - mpd-sima.git/blobdiff - sima/utils/config.py
Improved RandomFallBack and update documentation
[mpd-sima.git] / sima / utils / config.py
index 5d79e53a2bbcee6dc34f6fd477f7b79e921f61bf..da66366042e082ee7e0b73f410bef2e9511d0ac7 100644 (file)
@@ -1,6 +1,5 @@
 # -*- coding: utf-8 -*-
-
-# Copyright (c) 2009, 2010, 2011, 2013 Jack Kaliko <kaliko@azylum.org>
+# Copyright (c) 2009, 2010, 2011, 2013, 2014 Jack Kaliko <kaliko@azylum.org>
 #
 #  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):
         """