Esempio n. 1
0
def _dawn_setup():
    for plugin in pu.dawn_plugins.keys():
        p = pu.plugins[plugin]()
        pu.dawn_plugins[plugin]['input rank'] = \
            du.get_pattern_rank(p.get_plugin_pattern())
        pu.dawn_plugins[plugin]['description'] = p.__doc__.split(':param')[0]
        params = _get_dawn_parameters(p)
        pu.dawn_plugin_params[plugin] = params
Esempio n. 2
0
def _dawn_setup():
    for plugin in list(pu.dawn_plugins.keys()):
        p = pu.plugins[plugin]()
        pu.dawn_plugins[plugin]['input rank'] = \
            du.get_pattern_rank(p.get_plugin_pattern())
        pu.dawn_plugins[plugin]['description'] = p.__doc__.split(':param')[0]
        params = _get_dawn_parameters(p)
        pu.dawn_plugin_params[plugin] = params
Esempio n. 3
0
def populate_plugins():
    plugins_path = get_plugins_paths()
    savu_path = plugins_path[-1].split('savu')[0]
    savu_plugins = plugins_path[-1:]
    local_plugins = plugins_path[0:-1] + [savu_path + 'plugins_examples']

    # load local plugins
    for loader, module_name, is_pkg in pkgutil.walk_packages(local_plugins):
        _add_module(loader, module_name)

    # load savu plugins
    for loader, module_name, is_pkg in pkgutil.walk_packages(savu_plugins):
        if module_name.split('savu.plugins')[0] == '':
            _add_module(loader, module_name)

    for plugin in dawn_plugins.keys():
        p = load_plugin(dawn_plugins[plugin]['path2plugin'])  #.strip('.py'))
        dawn_plugins[plugin]['input rank'] = u.get_pattern_rank(
            p.get_plugin_pattern())
        dawn_plugins[plugin]['description'] = p.__doc__.split(':param')[0]
        params = get_parameters(p)
        dawn_plugin_params[plugin] = params