Beispiel #1
0
def _pluginUnloaded(*args):

    if len(args) > 1:
        # 2009 API callback, the args are
        # ( [ pluginName, pathToPlugin ], clientData )  OR
        # ( [ pathToPlugin ], clientData )
        pluginName = args[0][0]
    else:
        pluginName = args[0]

    _logger.debug("Plugin unloaded: %s" % pluginName)
    
    try:
        data = _pluginData.pop(pluginName)
    except KeyError:
        pass
    else:
        # Commands
        commands = data.pop('commands', [])
        if commands:
            _logger.debug("Removing commands: %s", ', '.join( commands ))
            for command in commands:
                try:
                    _pmcmds.removeWrappedCmd(command)
                    _module.__dict__.pop(command)
                except KeyError:
                    _logger.warn( "Failed to remove %s from module %s" % (command, _module.__name__) )

        # Nodes
        nodes = data.pop('dependNodes', [])
        if nodes:
            _logger.debug("Removing nodes: %s" % ', '.join( nodes ))
            for node in nodes:
                _factories.removePyNode( nodetypes, node )
Beispiel #2
0
def _removePluginNode(pluginName, node):
    global _pluginData

    nodes = _pluginData.get(pluginName, {}).get('dependNodes', [])
    if node in nodes:
        nodes.remove(node)
    _factories.removePyNode(nodetypes, node)
Beispiel #3
0
def _removePluginNode(pluginName, node):
    global _pluginData

    nodes = _pluginData.get(pluginName, {}).get('dependNodes', [])
    if node in nodes:
        nodes.remove(node)
    _factories.removePyNode( nodetypes, node )