1 # -*- coding: utf-8 -*-
5 First non-empty line of the docstring is used as description
6 Rest of the docstring at your convenience.
8 The plugin Name MUST be the same as the module (file name), case
9 insensitive: for instance plugin.py → Plugin
10 It eases plugins discovery and simplifies the code to handle them,
11 IMHO, it's a fair trade-off.
16 """self documenting class method
18 doc = 'Undocumented plugin! Fill "{}" docstring'.format(cls.__name__)
20 doc = cls.__doc__.strip(' \n').splitlines()[0]
21 return {'name': cls.__name__,
25 def __init__(self, daemon):
27 self.__daemon = daemon
28 self.plugin_conf = None
32 return self.__class__.__name__
34 def __get_config(self):
35 """Get plugin's specific configuration from global applications's config
37 conf = self.__daemon.config
38 for sec in conf.sections():
39 if sec.lower() == self.__class__.__name__.lower():
40 self.plugin_conf = dict(conf.items(sec))
42 # self.log.debug('Got config for {0}: {1}'.format(self,
45 def callback_player(self):
47 Called on player changes, stopped, paused, skipped
51 def callback_player_database(self):
53 Called on player music library changes
57 def callback_playlist(self):
59 Called on playlist changes
65 def callback_next_song(self):
66 """Not returning data,
67 Could be use to scrobble, maintain an history…
71 def callback_need_track(self):
72 """Returns a list of Track objects to add
76 def callback_need_track_fb(self):
77 """Called when callback_next_song failled to find tracks to queue
78 Returns a list of Track objects to add
87 # vim: ai ts=4 sw=4 sts=4 expandtab