1
##########################################################################
2
# Copyright 2009 Carlos Ribeiro
4
# This file is part of Radio Tray
6
# Radio Tray is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation, either version 1 of the License, or
9
# (at your option) any later version.
11
# Radio Tray is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with Radio Tray. If not, see <http://www.gnu.org/licenses/>.
19
##########################################################################
25
# This class should be extended by plugins implementations
26
class Plugin(threading.Thread):
29
threading.Thread.__init__(self)
30
self.log = logging.getLogger('radiotray')
32
def initialize(self, name, eventManagerWrapper, eventSubscriber, provider, cfgProvider, mediator, tooltip):
35
self.eventManagerWrapper = eventManagerWrapper
36
self.eventSubscriber = eventSubscriber
37
self.provider = provider
38
self.cfgProvider = cfgProvider
39
self.mediator = mediator
40
self.tooltip = tooltip
41
self.menuItem = gtk.MenuItem(self.getName(), False)
42
self.menuItem.connect('activate', self.on_menu)
51
raise NotImplementedError( "Subclasses should override this" )
54
print "Finalizing " + self.name
57
def setMenuItem(self, item):
60
def getMenuItem(self):
63
def hasMenuItem(self):