def __init__(self, controller, msn): Plugin.Plugin.__init__(self, controller, msn) self.description = _('A gmail notifier') self.authors = {'Jacopo Lamanna': '*****@*****.**'} self.website = 'www.jazzenco.org' self.displayName = _('gmailNotify') self.name = 'gmailNotify' self.config = controller.config self.config.readPluginConfig(self.name) self.enabled = False self.controller = controller self.isbutt = 0 self.checking = False self.deffun = Plugin.Function(self.function, self.callback)
def __init__(self, controller, msn): Plugin.Plugin.__init__(self, controller, msn) self.description = _('An IMAP mail checker') self.authors = { 'Jacopo Lamanna': '*****@*****.**', 'Astu': 'astu88 at gmail dot com' } self.website = 'www.jazzenco.org' self.displayName = _('mailChecker') self.name = 'mailChecker' self.config = controller.config self.config.readPluginConfig(self.name) self.enabled = False self.controller = controller self.isbutt = 0 self.checking = False self.deffun = Plugin.Function(self.function, self.callback)
def __init__(self, controller, msn): '''Constructor''' Plugin.Plugin.__init__(self, controller, msn, 1000) self.theme = controller.theme self.controller = controller self.description = PLUGIN_DESCRIPTION self.authors = PLUGIN_AUTHORS self.website = PLUGIN_WEBSITE self.displayName = PLUGIN_DISPLAYNAME self.name = PLUGIN_NAME self.configWindow = None self.statusLabel = None self.customConfigWidget = None self.usingDummy = True self.dictCommand = None self.Slash = controller.Slash self.config = controller.config self.config.readPluginConfig(self.name) self.setPlayer( self.config.getPluginValue( self.name, 'player', \ 'CurrentSong' ) ) self.player.setStyle( self.config.getPluginValue( self.name, 'style', \ '%title - %artist (%album)' ) ) self.avatar = self.config.getPluginValue(self.name, 'avatar', \ '0') == '1' self.remotefetch = self.config.getPluginValue(self.name, \ 'remotefetch', '0') == '1' self.updateCustomConf() self.timeout = 0 self.mediaEnabledId = 0 self.coverAvatar = Plugin.Function( self.getCoverAvatar, \ self.setCoverAvatar )
'''loads module specified by required(iterable) into dictionary (usually it's globals()). Return a list of (module, error) tuples for each module it wasn't able to import.''' error_list = [] for module in required: try: dictionary[module] = __import__(module, dictionary, locals(), []) except ImportError, error: error_list.append((module, error)) print 'Some errors occured on', module, ':', error return error_list if __name__ == '__main__': import time import Plugin def funcion(a,b): time.sleep(5) return a+b def callback( suma ): print suma f = Plugin.Function( funcion, callback ) f( 2,3 ) import gtk gtk.main()