X-Git-Url: http://git.kaliko.me/?a=blobdiff_plain;f=sima%2Flib%2Fplugin.py;h=5f709422410754a5be0a3d0dcfbcd5142bd92f22;hb=6d8430680bdea646cd17f27e3ec58c5f9ee1d629;hp=d44abafda47cd6eb142233c97d0d29252d47dedd;hpb=e09e76d41b2f041de935e9e884009e3187005ab9;p=mpd-sima.git diff --git a/sima/lib/plugin.py b/sima/lib/plugin.py index d44abaf..5f70942 100644 --- a/sima/lib/plugin.py +++ b/sima/lib/plugin.py @@ -1,6 +1,27 @@ # -*- coding: utf-8 -*- - -class Plugin(): +# Copyright (c) 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 . +# +# +""" +Plugin object to derive from +""" + +class Plugin: """ First non-empty line of the docstring is used as description Rest of the docstring at your convenience. @@ -25,6 +46,7 @@ class Plugin(): def __init__(self, daemon): self.log = daemon.log self.__daemon = daemon + self.player = daemon.player self.plugin_conf = None self.__get_config() @@ -36,8 +58,8 @@ class Plugin(): """ conf = self.__daemon.config for sec in conf.sections(): - if sec.lower() == self.__class__.__name__.lower(): - self.plugin_conf = dict(conf.items(sec)) + if sec == self.__class__.__name__.lower(): + self.plugin_conf = conf[sec] #if self.plugin_conf: # self.log.debug('Got config for {0}: {1}'.format(self, # self.plugin_conf)) @@ -80,6 +102,7 @@ class Plugin(): pass def shutdown(self): + """Called on application shutdown""" pass