Load all plugins and attach them to a CLI object.
505765
def load_cli_plugins(cli, config_dir=None):
    """"""
    from .config import load_master_config

    config = load_master_config(config_dir=config_dir)
    plugins = discover_plugins(config.Plugins.dirs)

    for plugin in plugins:
        if not hasattr(plugin, 'attach_to_cli'):  # pragma: no cover
            continue
        logger.debug("Attach plugin `%s` to CLI.", _fullname(plugin))
        # NOTE: plugin is a class, so we need to instantiate it.
        try:
            plugin().attach_to_cli(cli)
        except Exception as e:  # pragma: no cover
            logger.error("Error when loading plugin `%s`: %s", plugin, e)
878850
def LoadPlugins(cls):
        """"""

        if cls.PLUGINS_LOADED:
            return

        reg = ComponentRegistry()
        for _, record in reg.load_extensions('iotile.update_record'):
            cls.RegisterRecordType(record)

        cls.PLUGINS_LOADED = True
632036
public function loadPlugins()
    {
        $this->plugins = [];

        /**
         * Locate all plugins and binds them to the container
         */
        foreach ($this->getPluginNamespaces() as $namespace => $path) {
            $this->loadPlugin($namespace, $path);
        }

        return $this->plugins;
    }
635066
def load_plugins():
        
        plugin_cls = {}
        for entry_point in pkg_resources.iter_entry_points('docker_interface.plugins'):
            cls = entry_point.load()
            assert cls.COMMANDS is not None, \
                "plugin '%s' does not define its commands" % entry_point.name
            assert cls.ORDER is not None, \
                "plugin '%s' does not define its priority" % entry_point.name
            plugin_cls[entry_point.name] = cls
        return plugin_cls
964503
def load_plugins():
    
    plugins = os.environ.get('RAFCON_PLUGIN_PATH', '')
    plugin_list = set(plugins.split(os.pathsep))
    global plugin_dict
    for plugin_path in plugin_list:
        if not plugin_path:
            continue
        plugin_path = os.path.expandvars(os.path.expanduser(plugin_path)).strip()
        if not os.path.exists(plugin_path):
            logger.error("The specified plugin path does not exist: {}".format(plugin_path))
            continue
        dir_name, plugin_name = os.path.split(plugin_path.rstrip('/'))
        logger.info("Found plugin '{}' at {}".format(plugin_name, plugin_path))
        sys.path.insert(0, dir_name)
        if plugin_name in plugin_dict:
            logger.error("Plugin '{}' already loaded".format(plugin_name))
        else:
            try:
                module = importlib.import_module(plugin_name)
                plugin_dict[plugin_name] = module
                logger.info("Successfully loaded plugin '{}'".format(plugin_name))
            except ImportError as e:
                logger.error("Could not import plugin '{}': {}\n{}".format(plugin_name, e, str(traceback.format_exc())))
595655
def load_plugins(self):
        """"""
        from dyndnsc.plugins.builtin import PLUGINS
        for plugin in PLUGINS:
            self.add_plugin(plugin())
        super(BuiltinPluginManager, self).load_plugins()
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 */
  }
}
865680
def load_plugins(self, args=None):
        """"""
        for item in os.listdir(plugins_path):
            if (item.startswith(self.header) and
                    item.endswith(".py") and
                    item != (self.header + "plugin.py")):
                # Load the plugin
                self._load_plugin(os.path.basename(item),
                                  args=args, config=self.config)

        # Log plugins list
        logger.debug("Active plugins list: {}".format(self.getPluginsList()))
1148474
def run_plugins(plugins, url_data, stop_after_match=False, **kwargs):
    """"""
    for plugin in plugins:
        log.debug(LOG_PLUGIN, "Run plugin %s", plugin.__class__.__name__)
        if plugin.applies_to(url_data, **kwargs):
            plugin.check(url_data)
            if stop_after_match:
                break
1238516
def load_plugins(self):
        ''' 
        '''
        self._dbg("Loading plugins")
        if not self.active_plugins:
            self._dbg("No plugins specified in conf file")
            return  # nothing to load

        for plugin_path in self.active_plugins:
            self._dbg("Importing {}".format(plugin_path))

            if self.debug is True:
                # this makes the plugin fail with stack trace in debug mode
                cls = import_string(plugin_path)
            else:
                # otherwise we log the exception and carry on
                try:
                    cls = import_string(plugin_path)
                except ImportError as error:
                    logging.exception("Problem importing {} - {}".format(
                        plugin_path, error)
                    )

            plugin_config = self.config.get(cls.__name__, {})
            plugin = cls(slack_client=self.slack_client, plugin_config=plugin_config)  # instatiate!
            self.bot_plugins.append(plugin)
            self._dbg("Plugin registered: {}".format(plugin))
880983
def load_plugins(self, plugins):
        

        def instantiate(plugin):
            return plugin() if inspect.isclass(plugin) else plugin

        loaded_plugins = []
        plugins_seen = []

        # Iterate over plugins in reverse to permit users to override default
        # plugin config
        for plugin in reversed(plugins):
            if not is_plugin(plugin) or plugin.name in plugins_seen:
                continue
            # Build the plugins list in reverse to restore original order
            loaded_plugins.insert(0, instantiate(plugin))
            plugins_seen.append(plugin.name)

        return loaded_plugins
83877
def initialize_plugins(self):
        
        for plugin_name in self.options.plugin:
            parts = plugin_name.split('.')
            if len(parts) > 1:
                module_name = '.'.join(parts[:-1])
                class_name = parts[-1]
            else:
                # Use the titlecase format of the module name as the class name
                module_name = parts[0]
                class_name = parts[0].title()

            # First try to load plugins from the passed in plugins_dir and then
            # from the hairball.plugins package.
            plugin = None
            for package in (None, 'hairball.plugins'):
                if package:
                    module_name = '{}.{}'.format(package, module_name)
                try:
                    module = __import__(module_name, fromlist=[class_name])
                    # Initializes the plugin by calling its constructor
                    plugin = getattr(module, class_name)()

                    # Verify plugin is of the correct class
                    if not isinstance(plugin, HairballPlugin):
                        sys.stderr.write('Invalid type for plugin {}: {}\n'
                                         .format(plugin_name, type(plugin)))
                        plugin = None
                    else:
                        break
                except (ImportError, AttributeError):
                    pass
            if plugin:
                self.plugins.append(plugin)
            else:
                sys.stderr.write('Cannot find plugin {}\n'.format(plugin_name))
        if not self.plugins:
            sys.stderr.write('No plugins loaded. Goodbye!\n')
            sys.exit(1)
145308
def load_plugins(self):
        
        try:
            from pkg_resources import iter_entry_points
        except ImportError:
            return
        for ep in iter_entry_points(group="custodian.%s" % self.plugin_type):
            f = ep.load()
            f()
748141
private void loadPlugins() {

        final List<T> finalPluginsList = new ArrayList<T>();
        pluginsList = new ArrayList<T>();
        pluginsMap = new HashMap<String, T>();
        String className = null;

        try {
            final Class<T>[] classes = getClasses();
            for (final Class<T> clazz : classes) {

                className = clazz.getName();
                final T plugin = clazz.newInstance();

                if (plugin instanceof DelegatingModuleParser) {
                    ((DelegatingModuleParser) plugin).setFeedParser(parentParser);
                }

                if (plugin instanceof DelegatingModuleGenerator) {
                    ((DelegatingModuleGenerator) plugin).setFeedGenerator(parentGenerator);
                }

                pluginsMap.put(getKey(plugin), plugin);

                // to preserve the order of definition in the rome.properties files
                pluginsList.add(plugin);

            }

            final Collection<T> plugins = pluginsMap.values();
            for (final T plugin : plugins) {
                // to remove overridden plugin impls
                finalPluginsList.add(plugin);
            }

            final Iterator<T> iterator = pluginsList.iterator();
            while (iterator.hasNext()) {
                final T plugin = iterator.next();
                if (!finalPluginsList.contains(plugin)) {
                    iterator.remove();
                }
            }

        } catch (final Exception ex) {
            throw new RuntimeException("could not instantiate plugin " + className, ex);
        } catch (final ExceptionInInitializerError er) {
            throw new RuntimeException("could not instantiate plugin " + className, er);
        }

    }
668717
def run_plugins(self):
        
        for obj in self.loader.objects:
            # Reserve a slot in the output_dict in order to ensure that the
            # items are in the correct order.
            self.output_dict[obj.output_options['name']] = None
            self.thread_manager.add_thread(obj.main, obj.options['interval'])
196757
def init(plugindirs=[]):
    """"""

    # initialize the builtin plugins
    from .translators import yang,yin,dsdl
    yang.pyang_plugin_init()
    yin.pyang_plugin_init()
    dsdl.pyang_plugin_init()

    # initialize installed plugins
    for ep in pkg_resources.iter_entry_points(group='pyang.plugin'):
        plugin_init = ep.load()
        plugin_init()

    # search for plugins in std directories (plugins directory first)
    basedir = os.path.split(sys.modules['pyang'].__file__)[0]
    plugindirs.insert(0, basedir + "/transforms")
    plugindirs.insert(0, basedir + "/plugins")

    # add paths from env
    pluginpath = os.getenv('PYANG_PLUGINPATH')
    if pluginpath is not None:
        plugindirs.extend(pluginpath.split(os.pathsep))

    syspath = sys.path
    for plugindir in plugindirs:
        sys.path = [plugindir] + syspath
        try:
            fnames = os.listdir(plugindir)
        except OSError:
            continue
        modnames = []
        for fname in fnames:
            if (fname.startswith(".#") or
                fname.startswith("__init__.py") or
                fname.endswith("_flymake.py") or
                fname.endswith("_flymake.pyc")):
                pass
            elif fname.endswith(".py"):
                modname = fname[:-3]
                if modname not in modnames:
                    modnames.append(modname)
            elif fname.endswith(".pyc"):
                modname = fname[:-4]
                if modname not in modnames:
                    modnames.append(modname)
        for modname in modnames:
            pluginmod = __import__(modname)
            try:
                pluginmod.pyang_plugin_init()
            except AttributeError as s:
                print(pluginmod.__dict__)
                raise AttributeError(pluginmod.__file__ + ': ' + str(s))
        sys.path = syspath
92839
public function loadAllPlugins()
    {
        if (count($this->plugins) > 0) {
            foreach ($this->plugins as $plugin_name => $plugin) {
                $event_helpers = $plugin->getEventHelperCallbacks();
                if (count($event_helpers) > 0) {
                    foreach ($event_helpers as $event_name => $callback) {
                        if (!isset($this->events_helpers[$event_name])) {
                            $this->events_helpers[$event_name] = array();
                        }
                        $this->events_helpers[$event_name][] = $plugin; //add the plugin object to the map
                    }
                }
            }

            //register all event helpers
            if (count($this->events_helpers) > 0) {
                foreach ($this->events_helpers as $event_name => $plugin_objs) {
                    if (count($plugin_objs) > 0) {
                        $this->plugin_loading = true;
                        $this->on($event_name, function($event) use ($plugin_objs) {
                            return call_user_func_array(array($event, "register"), $plugin_objs)->start();
                        });
                        $this->plugin_loading = false;
                    }
                }
            }
        }
    }