Exemple #1
0
def loadPlugins(debug = None, progress = None):
    tapLookup = {}
    plugins = oldplugin._getPlugIns("tap", debug, progress)
    for plug in plugins:
        if hasattr(plug, 'tapname'):
            shortTapName = plug.tapname
        else:
            shortTapName = plug.module.split('.')[-1]
        tapLookup[shortTapName] = plug
    plugins = newplugin.getPlugins(IServiceMaker)
    for plug in plugins:
        tapLookup[plug.tapname] = plug
    return tapLookup
Exemple #2
0
def loadPlugins(debug=None, progress=None):
    tapLookup = {}

    plugins = oldplugin._getPlugIns("tap", debug, progress)
    for plug in plugins:
        if hasattr(plug, 'tapname'):
            shortTapName = plug.tapname
        else:
            shortTapName = plug.module.split('.')[-1]
        tapLookup[shortTapName] = plug

    plugins = newplugin.getPlugins(IServiceMaker)
    for plug in plugins:
        tapLookup[plug.tapname] = plug

    return tapLookup
Exemple #3
0
def getProcessor(input, output, config):
    plugins = oldplugin._getPlugIns("lore")
    for plug in plugins:
        if plug.tapname == input:
            module = plug.load()
            break
    else:
        plugins = newplugin.getPlugins(IProcessor)
        for plug in plugins:
            if plug.name == input:
                module = reflect.namedModule(plug.moduleName)
                break
        else:
            # try treating it as a module name
            try:
                module = reflect.namedModule(input)
            except ImportError:
                print '%s: no such input: %s' % (sys.argv[0], input)
                return
    try:
        return process.getProcessor(module, output, config)
    except process.NoProcessorError, e:
        print "%s: %s" % (sys.argv[0], e)
Exemple #4
0
def getProcessor(input, output, config):
    plugins = oldplugin._getPlugIns("lore")
    for plug in plugins:
        if plug.tapname == input:
            module = plug.load()
            break
    else:
        plugins = newplugin.getPlugins(IProcessor)
        for plug in plugins:
            if plug.name == input:
                module = reflect.namedModule(plug.moduleName)
                break
        else:
            # try treating it as a module name
            try:
                module = reflect.namedModule(input)
            except ImportError:
                print '%s: no such input: %s' % (sys.argv[0], input)
                return
    try:
        return process.getProcessor(module, output, config)
    except process.NoProcessorError, e:
        print "%s: %s" % (sys.argv[0], e)