コード例 #1
0
ファイル: __init__.py プロジェクト: jldupont/rb_squeezebox
class SqueezeboxPlugin (rb.Plugin):
    
    BUSNAME="__pluging__"
    
    def __init__ (self):
        rb.Plugin.__init__ (self)
        self.main=PluginAgent()
        Bus.subscribe(self.BUSNAME, "devmode?", self.hq_devmode)
        Bus.subscribe(self.BUSNAME, "appname?", self.hq_appname)

    def activate (self, shell):
        """
        When RB activates this plugin
        """
        self.main.activate(shell)
        
    def deactivate(self, shell):
        """
        When RB deactivates this plugin
        """
        self.main.deactivate(shell)

    ## ======================================================= Message Handlers
            
    def hq_appname(self):
        Bus.publish(self.BUSNAME, "appname", PLUGIN_NAME)
        
    def hq_devmode(self):
        Bus.publish(self.BUSNAME, "devmode", DEV_MODE)