(self)
Forge an URLhandler plugin and hide it in the available ones.
Forge an URLhandler plugin and hide it in the available ones.
Forge an URLhandler plugin and hide it in the available ones .
def _load_configured_handlers(self):
        """Forge an URLhandler plugin and hide it in the available ones."""
        me = sys.modules[__name__] # Current module.
        config = Config()

        for key,handler in [ (key,self.cmd_list[key]) for key in sorted(self.cmd_list.keys()) ] :
            # Forge a hidden/managed plugin
            # (names starting with an underscore will not be displayed in the preference/plugins window).
            rcom_name = "_RunCmdOnMatch_{}".format(key) # key is just the index
            # Make a handler class.
            RCOM = MetaRCOM(rcom_name, handler["regexp"], handler["command"])
            # Instanciate the class.
            setattr(me, rcom_name, RCOM)

            if rcom_name not in AVAILABLE:
                AVAILABLE.append(rcom_name)
                dbg("add {} to the list of URL handlers: '{}' -> '{}'".format(rcom_name, RCOM.match, RCOM.cmd))

            if handler['enabled'] and rcom_name not in config["enabled_plugins"]:
                config["enabled_plugins"].append(rcom_name)

        config.save()
def _load_configured_handlers ( self ) : me = sys . modules [ __name__ ] # Current module. config = Config ( ) for key , handler in [ ( key , self . cmd_list [ key ] ) for key in sorted ( self . cmd_list . keys ( ) ) ] : # Forge a hidden/managed plugin # (names starting with an underscore will not be displayed in the preference/plugins window). rcom_name = "_RunCmdOnMatch_{}" . format ( key ) # key is just the index # Make a handler class. RCOM = MetaRCOM ( rcom_name , handler [ "regexp" ] , handler [ "command" ] ) # Instanciate the class. setattr ( me , rcom_name , RCOM ) if rcom_name not in AVAILABLE : AVAILABLE . append ( rcom_name ) dbg ( "add {} to the list of URL handlers: '{}' -> '{}'" . format ( rcom_name , RCOM . match , RCOM . cmd ) ) if handler [ 'enabled' ] and rcom_name not in config [ "enabled_plugins" ] : config [ "enabled_plugins" ] . append ( rcom_name ) config . save ( )