Attempts to load plugin modules according to the order of available
            plugin directories.
194477
def _load_plugins(self):
        

        # import base plugin modules
        try:
            __import__('focus.plugin.modules')
            #import focus.plugin.modules
        except ImportError as exc:
            raise errors.PluginImport(unicode(exc))

        # load user defined plugin modules
        try:
            user_plugin_dir = os.path.join(self._data_dir, 'plugins')
            _import_modules(user_plugin_dir)

        except Exception as exc:
            raise errors.UserPluginImport(unicode(exc))
813006
def _load_all(self):
        '''
        
        '''
        with self._lock:
            for name in self.file_mapping:
                if name in self.loaded_files or name in self.missing_modules:
                    continue
                self._load_module(name)

            self.loaded = True
1240672
def _load_plugins_itr(pgroup, safe=True):
    
    for res in pkg_resources.iter_entry_points(pgroup):
        try:
            yield res.load()
        except ImportError:
            if safe:
                continue
            raise
444734
function loadLocalPlugins(searchpath, pluginInfoProvider) {
    if (localPlugins) {
        // localPlugins already populated, nothing to do.
        // just in case, make sure it was loaded with the same search path
        if (!underscore.isEqual(localPlugins.searchpath, searchpath)) {
            var msg = 'loadLocalPlugins called twice with different search paths.' + 'Support for this is not implemented.';
            throw new Error(msg);
        }
        return;
    }
    // Populate localPlugins object.
    localPlugins = {};
    localPlugins.searchpath = searchpath;
    localPlugins.plugins = {};
    searchpath.forEach(function (dir) {
        var ps = pluginInfoProvider.getAllWithinSearchPath(dir);
        ps.forEach(function (p) {
            var versions = localPlugins.plugins[p.id] || [];
            versions.push(p);
            localPlugins.plugins[p.id] = versions;
        });
    });
}
676956
def discover_plugin(module_path)
        plugin = plugin_classes.find {|c| c.send(:valid_module_dir?, module_path) }
        raise NoSuitablePluginFoundException unless plugin
        plugin
     end
795258
def find_plugins():
     
    plugin_dir = os.path.dirname(os.path.realpath(__file__))
    plugin_dir = os.path.join(plugin_dir, "plugins")
    plugin_files = [x[:-3] for x in os.listdir(plugin_dir) if x.endswith(".py")]
    sys.path.insert(0, plugin_dir)
    for plugin in plugin_files:
        __import__(plugin)
1343590
function loadPluginsFromDir(dir, config) {
  try {
    fs
      .readdirSync(dir)
      .filter(resource => {
        if (path.basename(dir) != 'plugins') return RE_PLUGIN.test(resource);
        return RE_JS_FILE.test(resource) || fs.statSync(path.join(dir, resource)).isDirectory();
      })
      .forEach(resource => {
        registerPlugin(path.join(dir, resource), config);
      });
  } catch (err) {
    /* ignore */
  }
}
653424
def are_plugins_in_order(plugins_conf, *plugins_names):
    """"""
    all_plugins_names = [plugin['name'] for plugin in plugins_conf or []]
    start_index = 0
    for plugin_name in plugins_names:
        try:
            start_index = all_plugins_names.index(plugin_name, start_index)
        except ValueError:
            return False
    return True
563316
def get_plugin_modules(folders, package='plugins',
                       parentpackage='linkcheck.dummy'):
    """"""
    for folder in folders:
        for module in loader.get_folder_modules(folder, parentpackage):
            yield module
    for module in loader.get_package_modules(package):
        yield module
472716
def load_all_plugins(self):
        """"""

        # Go through the existing python files in the plugin directory
        self.plugin_path = os.path.realpath(self.plugin_dir)
        sys.path.append(self.plugin_dir)
        print '<<< Plugin Manager >>>'
        for f in [os.path.join(self.plugin_dir, child) for child in os.listdir(self.plugin_dir)]:

            # Skip certain files
            if '.DS_Store' in f or '__init__.py' in f: 
                continue

            # Add the plugin
            self.add_plugin(f)
444516
def load_plugins_from_module(module_name):
    
    plugins = {}

    try:
        if module_name.endswith('.py'):
            import imp
            mod = imp.load_source('module.name', module_name)
        else:
            mod = importlib.import_module(module_name)
    except Exception as e:
        logger.debug("Import module <{}> failed: {}".format(module_name, e))
        return {}
    for _, cls in inspect.getmembers(mod, inspect.isclass):
        # Don't try to register plugins imported into this module elsewhere
        if issubclass(cls, (Catalog, DataSource)):
            plugins[cls.name] = cls

    return plugins
941661
def load_plugins(self):
        """"""
        from pkg_resources import iter_entry_points
        seen = set()
        for entry_point in self.entry_points:
            for ep in iter_entry_points(entry_point):
                if ep.name in seen:
                    continue
                seen.add(ep.name)
                try:
                    plugincls = ep.load()
                except Exception as exc:
                    # never let a plugin load kill us
                    warn("Unable to load plugin %s: %s" % (ep, exc),
                         RuntimeWarning)
                    continue
                plugin = plugincls()
                self.add_plugin(plugin)
        super(EntryPointPluginManager, self).load_plugins()
276367
private void createMainModule()
    {
        for (Plugin plugin : orderedPlugins)
        {
            moduleHandler.handleUnitModule(requestHandler, plugin);
            moduleHandler.handleOverridingUnitModule(requestHandler, plugin);
        }
        KernelGuiceModuleInternal kernelGuiceModuleInternal = new KernelGuiceModuleInternal(requestHandler);
        KernelGuiceModuleInternal internalKernelGuiceModuleOverriding = new KernelGuiceModuleInternal(requestHandler).overriding();
        mainModule = Modules.override(kernelGuiceModuleInternal).with(internalKernelGuiceModuleOverriding);
    }
1226345
def list_local_plugins(plugin_type, plugins_path, plugin_details):
    """"""
    installed_plugins = list()
    for plugin in next(os.walk(plugins_path))[1]:
        s = plugin_details(plugin)
        installed_plugins.append(plugin)
        click.secho(s)

    if not installed_plugins:
        click.secho("[*] You do not have any {0}s installed, "
                    "try installing one with `honeycomb {0} install`".format(plugin_type))

    return installed_plugins
503929
def refresh_files(self):
        
        plugins = {}
        _plugin_files = glob.glob(os.path.join(self.dir_path, '[!_]*.pyc'))
        for f in glob.glob(os.path.join(self.dir_path, '[!_]*.py')):
            if not any(os.path.splitext(f)[0] == os.path.splitext(x)[0]
                    for x in _plugin_files):
                logging.debug('Adding plugin {0}'.format(f))
                _plugin_files.append(f)
        for f in _plugin_files:
            plugin = self._load_compiled(f)
            plugins[plugin.__name__] = plugin
            logging.debug('Loaded module object for plugin: {0}'.format(f))
        return plugins
852522
def get_loaded_modules(modules):
    ''''''

    _modules = []
    for mod in modules:
        mod_cfg = get_conf_from_module(mod)

        _modules.append((mod, mod_cfg,))

    _modules = sorted(_modules, key=lambda m: m[1].get('ordering'))

    return _modules
503814
def _load_plugins(self):
        
        plugins = ait.config.get('server.plugins')

        if plugins is None:
            log.warn('No plugins specified in config.')
        else:
            for index, p in enumerate(plugins):
                try:
                    plugin = self._create_plugin(p['plugin'])
                    self.plugins.append(plugin)
                    log.info('Added plugin {}'.format(plugin))

                except Exception:
                    exc_type, value, tb = sys.exc_info()
                    log.error('{} creating plugin {}: {}'.format(exc_type,
                                                                 index,
                                                                 value))
            if not self.plugins:
                log.warn('No valid plugin configurations found. No plugins will be added.')