]> kaliko git repositories - mpd-sima.git/blobdiff - sima/utils/config.py
Simplified configuration manager (db_file's no longer a special case)
[mpd-sima.git] / sima / utils / config.py
index 1dd9567835d6411affbcf963edd6a7b31b4b4107..5d79e53a2bbcee6dc34f6fd477f7b79e921f61bf 100644 (file)
@@ -42,25 +42,33 @@ CONF_FILE = 'sima.cfg'
 DEFAULT_CONF = {
         'MPD': {
             'host': "localhost",
-            'password': "false",
+            #'password': "",
             'port': "6600"},
         'sima': {
-            'similarity': "15",
-            'dynamic': "10",
-            'queue_mode': "track", #TODO control values
             'user_db': "false",
             'history_duration': "8",
             'queue_length': "1",
-            'track_to_add': "1",
-            'album_to_add': "1",
-            'consume': "0",
-            'single_album': "false",
-            'check_new_version':"false",},
+            'consume': "0",},
         'daemon':{
             'daemon': "false",
             'pidfile': "",},
         'log': {
-            'verbosity': "info"}}
+            'verbosity': "info",
+            'logfile': "",},
+        'lastfm': {
+            'dynamic': "10",
+            'similarity': "20",
+            'queue_mode': "track", #TODO control values
+            'single_album': "false",
+            'track_to_add': "1",
+            'album_to_add': "1",
+            'depth': "1",
+            },
+        'randomfallback': {
+            'flavour': "sensible", # in pure, sensible, genre
+            'track_to_add': "1",
+            }
+        }
 #
 
 
@@ -97,6 +105,7 @@ class ConfMan(object):  # CONFIG MANAGER CLASS
         self.init_config()
         self.control_conf()
         self.supersedes_config_with_cmd_line_options()
+        self.config['sima']['db_file'] = self.db_file
 
     def get_pw(self):
         try:
@@ -226,7 +235,6 @@ class ConfMan(object):  # CONFIG MANAGER CLASS
         self.db_file = join(data_dir, 'sima.db')
 
         config = configparser.SafeConfigParser()
-
         # If no conf file present, uses defaults
         if not isfile(self.conf_file):
             self.config = config