]> kaliko git repositories - mpd-sima.git/blobdiff - sima/core.py
Get through main loop in case of player reconnection
[mpd-sima.git] / sima / core.py
index f6703ca8317b0c204fce89e8234cd139518bd38d..694928fa77815ddd017aab71c4b2c9aadd2a4b78 100644 (file)
@@ -27,6 +27,7 @@ class Sima(Daemon):
         self.enabled = True
         self.config = conf
         self.sdb = SimaDB(db_path=conf.get('sima', 'db_file'))
+        PlayerClient.database = self.sdb
         self.log = getLogger('sima')
         self.plugins = list()
         self.player = self.__get_player()  # Player client
@@ -114,7 +115,6 @@ class Sima(Daemon):
         self.log.info('The way is shut, it was made by those who are dead. '
                       'And the dead keep it…')
         self.log.info('bye...')
-        sys.exit(0)
 
     def run(self):
         """
@@ -131,6 +131,7 @@ class Sima(Daemon):
             except PlayerError as err:
                 self.log.warning('Player error: %s' % err)
                 self.reconnect_player()
+                del(self.changed)
 
     def loop(self):
         """Dispatching callbacks to plugins