]> kaliko git repositories - mpd-sima.git/blobdiff - sima/core.py
Simplified configuration manager (db_file's no longer a special case)
[mpd-sima.git] / sima / core.py
index ad21db6f16da571b46d7f8b7ac68253c04421f7c..e3bde2c6abfec4b43d2034ff8d46f5dd2a75691d 100644 (file)
@@ -20,13 +20,13 @@ class Sima(object):
     """Main class, plugin and player management
     """
 
-    def __init__(self, conf, dbfile):
+    def __init__(self, conf):
         self.enabled = True
         self.config = conf
-        self.sdb = SimaDB(db_path=dbfile)
+        self.sdb = SimaDB(db_path=conf.get('sima', 'db_file'))
         self.log = getLogger('sima')
         self.plugins = list()
-        self.player = self._get_player()  # Player client
+        self.player = self.__get_player()  # Player client
         try:
             self.player.connect()
         except (PlayerError, PlayerUnHandledError) as err:
@@ -34,7 +34,7 @@ class Sima(object):
             self.shutdown()
         self.short_history = deque(maxlen=60)
 
-    def _get_player(self):
+    def __get_player(self):
         """Instanciate the player"""
         host = self.config.get('MPD', 'host')
         port = self.config.get('MPD', 'port')