X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Fcore.py;h=adbefa2218a3016fcf553f238cc75e5730be0479;hb=43c17d62ce2f4ac6010316ff036842dc25aaba4a;hp=694928fa77815ddd017aab71c4b2c9aadd2a4b78;hpb=5c2b74bd18e344432a92ff20fefe68968843d61e;p=mpd-sima.git diff --git a/sima/core.py b/sima/core.py index 694928f..adbefa2 100644 --- a/sima/core.py +++ b/sima/core.py @@ -2,10 +2,6 @@ """Core Object dealing with plugins and player client """ -__version__ = '0.12.0pr1' -__author__ = 'kaliko jack' -__url__ = 'git://git.kaliko.me/sima.git' - import sys import time @@ -16,6 +12,7 @@ from .client import PlayerClient from .client import PlayerError, PlayerUnHandledError from .lib.simadb import SimaDB from .lib.daemon import Daemon +from .utils.utils import SigHup class Sima(Daemon): """Main class, plugin and player management @@ -105,6 +102,12 @@ class Sima(Daemon): self.log.info('Got reconnected') break + def hup_handler(self, signum, frame): + self.log.warning('Caught a sighup!') + self.player.disconnect() + self.foreach_plugin('shutdown') + raise SigHup('SIGHUP caught!') + def shutdown(self): """General shutdown method """