X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Fcore.py;h=31111fca00312bde925e337fd0bd067f5cd4910f;hb=78a694ddcd2a6ecc8b2b1fd3c74ee2d938707305;hp=8e075b0a28ace0a7078ee87b98083d4c38454c50;hpb=cae35b4090eaeb8eec24c7ea77ec2311f3fc0608;p=mpd-sima.git diff --git a/sima/core.py b/sima/core.py index 8e075b0..31111fc 100644 --- a/sima/core.py +++ b/sima/core.py @@ -1,8 +1,25 @@ # -*- coding: utf-8 -*- +# Copyright (c) 2009, 2010, 2011, 2013, 2014 Jack Kaliko +# +# This file is part of sima +# +# sima is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# sima is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with sima. If not, see . +# +# """Core Object dealing with plugins and player client """ -import sys import time from collections import deque @@ -31,9 +48,7 @@ class Sima(Daemon): try: self.player.connect() except (PlayerError, PlayerUnHandledError) as err: - self.log.error('Fails to connect player: {}'.format(err)) - self.shutdown() - sys.exit(1) + self.log.warning('Player: {}'.format(err)) self.short_history = deque(maxlen=60) def __get_player(self): @@ -44,6 +59,7 @@ class Sima(Daemon): return PlayerClient(host, port, pswd) def add_history(self): + """Handle local short history""" self.short_history.appendleft(self.player.current) def register_plugin(self, plugin_class): @@ -57,6 +73,7 @@ class Sima(Daemon): getattr(plugin, method)(*args, **kwds) def need_tracks(self): + """Is the player in need for tracks""" if not self.enabled: self.log.debug('Queueing disabled!') return False