Helper method used to load the correct plugin.
4048
public function loadProcessorPlugins(&$values, $item, $entity_type) {
    $manager = \Drupal::service('plugin.manager.import_processor');
    $import_processors = $manager->getDefinitions();
    foreach ($import_processors as $plugin_id => $import_processor) {
      if ($import_processor['type'] == $entity_type . ':' . $item['type']) {
        /** @var \Drupal\govcms8_default_content\ImportProcessorBase $processor */
        $processor = $manager->createInstance($plugin_id);
        $processor->setItem($item);
        $processor->process($values);
      }
    }
  }
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()))
972638
private static ClassLoader pluginClassLoader(final Path plugin,
                                               final ClassLoader environment,
                                               final ClassLoader parent) {
    final URL url;
    try {
      url = plugin.toFile().toURI().toURL();
    } catch (MalformedURLException e) {
      throw new RuntimeException("Failed to load plugin jar " + plugin, e);
    }
    final ClassLoader providedClassLoader = new FilteringClassLoader(PROVIDED, environment, parent);
    return new URLClassLoader(new URL[]{ url }, providedClassLoader);
  }
879225
def get_plugin(self, method):
        
        all_plugins = []
        for entry_point in pkg_resources.iter_entry_points('yolk.plugins'):
            plugin_obj = entry_point.load()
            plugin = plugin_obj()
            plugin.configure(self.options, None)
            if plugin.enabled:
                if not hasattr(plugin, method):
                    self.logger.warn("Error: plugin has no method: %s" % method)
                    plugin = None
                else:
                    all_plugins.append(plugin)
        return all_plugins
1111383
def _load(self, ):
        
        try:
            self.init()
        except Exception as e:
            log.exception("Load failed!")
            raise errors.PluginInitError('%s' % e)
        self.__status = self.__LOADED
790168
def _plugin_get(self, plugin_name):
        
        if not plugin_name:
            return None, u"Plugin name not set"
        for plugin in self.controller.plugins:
            if not isinstance(plugin, SettablePlugin):
                continue
            if plugin.name == plugin_name:
                return plugin, ""
        return None, u"Settable plugin '{}' not found".format(plugin_name)
388894
private function loadPlugins(): void
    {
        $finder = Finder::create();
        $finder
            ->name('*Plugin.php')
        ;
        if (is_dir($dir = __DIR__.'/../Plugins')) {
            $finder->in(__DIR__.'/../Plugins');
        }
        $dirs = $this->loadDirectoryFromAutoloader();
        $finder->in($dirs);
        foreach ($finder->files() as $file) {
            $namespace = 'Dotfiles\\Plugins\\'.str_replace('Plugin.php', '', $file->getFileName());
            $className = $namespace.'\\'.str_replace('.php', '', $file->getFileName());
            if (class_exists($className)) {
                /* @var \Dotfiles\Core\Plugin $plugin */
                $plugin = new $className();
                $this->registerPlugin($plugin);
            }
        }
    }
13896
def load_modules(self, modules, config):
        """"""
        for pluginclass in get_plugin_classes(modules):
            name = pluginclass.__name__
            if name in config["enabledplugins"]:
                if issubclass(pluginclass, _ConnectionPlugin):
                    log.debug(LOG_PLUGIN, "Enable connection plugin %s", name)
                    self.connection_plugins.append(pluginclass(config[name]))
                elif issubclass(pluginclass, _ContentPlugin):
                    log.debug(LOG_PLUGIN, "Enable content plugin %s", name)
                    self.content_plugins.append(pluginclass(config[name]))
                elif issubclass(pluginclass, _ParserPlugin):
                    log.debug(LOG_PLUGIN, "Enable parser plugin %s", name)
                    self.parser_plugins.append(pluginclass(config[name]))
                else:
                    raise ValueError("Invalid plugin class %s" % pluginclass)
169991
def load_base(namespace, plugin_type, provider, options = {})
    logger.info("Fetching plugin #{namespace} #{plugin_type} provider #{provider} at #{Time.now}")

    type_info  = loaded_plugin(namespace, plugin_type, provider)
    options    = translate_type(type_info, options)
    config     = Config.ensure(options)

    provider   = config.get(:provider, provider)
    name       = config.get(:name, nil)
    ensure_new = config.get(:new, false)

    if name
      logger.debug("Looking up existing instance of #{name}")

      if existing_instance = get(namespace, plugin_type, name)
        unless ensure_new
          config.delete(:new)

          config.export.each do |property_name, value|
            unless [ :name, :meta ].include?(property_name)
              existing_instance[property_name] = value
            end
          end
          existing_instance.normalize(true)

          logger.debug("Using existing instance of #{plugin_type}, #{name}")
          return existing_instance
        end
      end
    end
    create(namespace, plugin_type, provider, config)
  end
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()
1234975
static public function loadPlugin($plugin=null)
	{
	    $path = Config::getPluginPath();
	    if ($plugin) {
	        $pluginPath = $path . trim($plugin, '/') . '/autoload.php';
	        static::load($pluginPath);
	    }
	}
490769
public void loadPlugins() throws PluginException {
        if (initialised) {
            return;
        }

        ClassLoader gcl = application.getClassLoader();

        attemptLoadPlugins(gcl);

        if (!delayedLoadPlugins.isEmpty()) {
            loadDelayedPlugins();
        }
        if (!delayedEvictions.isEmpty()) {
            processDelayedEvictions();
        }

        pluginList = sortPlugins(pluginList);
        initializePlugins();
        initialised = true;
    }
662019
public function loadPlugins()
    {
        $activePlugins = $this->getActivePlugins();
        foreach ($activePlugins as $plugin) {
            if ($class = $this->load($plugin)) {
                $class->run();
            }
        }
    }
639879
def _load_plugins(self):
        '''
        
        '''
        plugins = self.settings['PLUGINS']

        self.plugins_dict = {}
        for key in plugins:
            # skip loading the plugin if its value is None
            if plugins[key] is None:
                continue
            # valid plugin, import and setup
            self.logger.debug("Trying to load plugin {cls}".format(cls=key))
            the_class = self._import_class(key)
            instance = the_class()
            instance._set_logger(self.logger)
            if not self.unit_test:
                instance.setup(self.settings)
            the_schema = None
            with open(self.settings['PLUGIN_DIR'] + instance.schema) as the_file:
                the_schema = json.load(the_file)

            mini = {}
            mini['instance'] = instance
            mini['schema'] = the_schema
            self.logger.debug("Successfully loaded plugin {cls}".format(cls=key))
            self.plugins_dict[plugins[key]] = mini

        self.plugins_dict = OrderedDict(sorted(list(self.plugins_dict.items()),
                                               key=lambda t: t[0]))
1243563
def install(self, plugin, name=None, **opts):
        """"""
        source = plugin

        if isinstance(plugin, str):
            module, _, attr = plugin.partition(':')
            module = import_module(module)
            plugin = getattr(module, attr or 'Plugin', None)

        if isinstance(plugin, types.ModuleType):
            plugin = getattr(module, 'Plugin', None)

        if plugin is None:
            raise MuffinException('Plugin is not found %r' % source)

        name = name or plugin.name
        if name in self.ps:
            raise MuffinException('Plugin with name `%s` is already intalled.' % name)

        if isinstance(plugin, type):
            plugin = plugin(**opts)

        if hasattr(plugin, 'setup'):
            plugin.setup(self)

        if hasattr(plugin, 'middleware') and plugin.middleware not in self.middlewares:
            self.middlewares.append(plugin.middleware)

        if hasattr(plugin, 'startup'):
            self.on_startup.append(plugin.startup)

        if hasattr(plugin, 'cleanup'):
            self.on_cleanup.append(plugin.cleanup)

        # Save plugin links
        self.ps[name] = plugin

        return plugin
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);
        }

    }
595655
def load_plugins(self):
        """"""
        from dyndnsc.plugins.builtin import PLUGINS
        for plugin in PLUGINS:
            self.add_plugin(plugin())
        super(BuiltinPluginManager, self).load_plugins()