Example #1
0
def test_all_plugins():
    count = 0
    for m in cache.get_plugins():
        cls = cache.get_plugin(m)
        if not cls:
            continue
        log.info("Plugin Name: %s", m)
        count += 1
        yield check_plugin, cls
        yield run_plugin, cls
    assert count
Example #2
0
def test_all_plugins():
    count = 0
    for m in cache.get_plugins():
        cls = cache.get_plugin(m)
        if not cls:
            continue
        log.info("Plugin Name: %s", m)
        count += 1
        yield check_plugin, cls
        yield run_plugin, cls
    assert count
Example #3
0
def test_pluginscan():
    plugins = []
    d = os.path.dirname(__file__)
    for path in [
            os.path.join(d, '../../plugin'),
            os.path.join(d, '../../rndplugins')
    ]:
        path = os.path.normpath(os.path.abspath(path))
        if not os.path.exists(path):
            logger.debug("skipping '%s'", path)
            continue
        for (dirpath, dirnames, filenames) in os.walk(path):
            for name in dirnames:
                launchsh = os.path.join(dirpath, name, 'launch.sh')
                if os.path.exists(launchsh):
                    plugins.append((name, launchsh))
                    continue
                # Find all instances of PluginName/PluginName.py
                plugindef = os.path.join(dirpath, name, name + '.py')
                if os.path.exists(plugindef):
                    #sys.path.append(os.path.join(dirpath, name))
                    plugins.append((name, plugindef))

    logger.debug("Plugins: '%s'", plugins)

    cache.set_installed_modules(plugins)

    for (name, err) in cache.get_errors().iteritems():
        if err.__class__.__name__ == 'ImportError':
            logger.warn("Import Error [%s]: %s", name, err)
        else:
            logger.warn("Syntax Error [%s]: %s: %s", name,
                        err.__class__.__name__, err)

    for m in cache.get_plugins():
        cls = cache.get_plugin(m)
        if not cls:
            continue
        logger.info("Plugin Name: %s", m)
        yield check_plugin, cls
Example #4
0
def test_pluginscan():
    plugins = []
    d = os.path.dirname(__file__)
    for path in [os.path.join(d,'../../plugin'), os.path.join(d,'../../rndplugins') ]:
        path = os.path.normpath(os.path.abspath(path))
        if not os.path.exists(path):
            logger.debug("skipping '%s'", path)
            continue
        for (dirpath, dirnames, filenames) in os.walk(path):
            for name in dirnames:
                launchsh = os.path.join(dirpath, name, 'launch.sh')
                if os.path.exists(launchsh):
                    plugins.append( (name, launchsh) )
                    continue
                # Find all instances of PluginName/PluginName.py
                plugindef = os.path.join(dirpath, name, name + '.py')
                if os.path.exists(plugindef):
                    #sys.path.append(os.path.join(dirpath, name))
                    plugins.append( (name, plugindef) )

    logger.debug("Plugins: '%s'", plugins)

    cache.set_installed_modules(plugins)

    for (name, err) in cache.get_errors().iteritems():
        if err.__class__.__name__ == 'ImportError':
            logger.warn("Import Error [%s]: %s", name, err)
        else:
            logger.warn("Syntax Error [%s]: %s: %s", name, err.__class__.__name__, err)

    for m in cache.get_plugins():
        cls = cache.get_plugin(m)
        if not cls:
            continue
        logger.info("Plugin Name: %s", m)
        yield check_plugin, cls