Пример #1
0
def loadPackageAllPlugins(package):
    module_names = explorePackage(package)
    for module_name in module_names:
        if not isTestModule(module_name):
            importlib.import_module(module_name)

    return getLoadedPlugins()
Пример #2
0
def loadPackage(name, package):
    module_names = explorePackage(package)
    for module_name in module_names:
        if not isTestModule(module_name):
            importlib.import_module(module_name)

    for key, value in Types.ALL.iteritems():
        for cls in value.plugins:
            if name == cls.className():
                return cls

    raise NotFoundPlugin("The plugin '%s' was not found." % name)