Loads all found plugins

        :returns: None
        :rtype: None
        :raises: None
764485
def load_plugins(self, ):
        
        for p in self.__plugins.values():
            try:
                self.load_plugin(p)
            except errors.PluginInitError:
                log.exception('Initializing the plugin: %s failed.' % p)
577615
def get_plugins_by_feature(features):
    
    if not features:
        return get_all_plugins()
    plugins = PluginLoader.load_all().items()
    names = set([f.__name__ for f in features])
    return [e for e, plugin in plugins if names & set(plugin.__dict__.keys())]
708498
def load_plugins(self, plugin_class_name):
        
        # imp.findmodule('atomic_reactor') doesn't work
        plugins_dir = os.path.join(os.path.dirname(__file__), 'plugins')
        logger.debug("loading plugins from dir '%s'", plugins_dir)
        files = [os.path.join(plugins_dir, f)
                 for f in os.listdir(plugins_dir)
                 if f.endswith(".py")]
        if self.plugin_files:
            logger.debug("loading additional plugins from files '%s'", self.plugin_files)
            files += self.plugin_files
        plugin_class = globals()[plugin_class_name]
        plugin_classes = {}
        for f in files:
            module_name = os.path.basename(f).rsplit('.', 1)[0]
            # Do not reload plugins
            if module_name in sys.modules:
                f_module = sys.modules[module_name]
            else:
                try:
                    logger.debug("load file '%s'", f)
                    f_module = imp.load_source(module_name, f)
                except (IOError, OSError, ImportError, SyntaxError) as ex:
                    logger.warning("can't load module '%s': %r", f, ex)
                    continue
            for name in dir(f_module):
                binding = getattr(f_module, name, None)
                try:
                    # if you try to compare binding and PostBuildPlugin, python won't match them
                    # if you call this script directly b/c:
                    # ! <class 'plugins.plugin_rpmqa.PostBuildRPMqaPlugin'> <= <class
                    # '__main__.PostBuildPlugin'>
                    # but
                    # <class 'plugins.plugin_rpmqa.PostBuildRPMqaPlugin'> <= <class
                    # 'atomic_reactor.plugin.PostBuildPlugin'>
                    is_sub = issubclass(binding, plugin_class)
                except TypeError:
                    is_sub = False
                if binding and is_sub and plugin_class.__name__ != binding.__name__:
                    plugin_classes[binding.key] = binding
        return plugin_classes
581896
def get_plugins(namespace, interface=None, check_extras=True, load_now=False):
    
    return _DB.add_namespace(namespace, interface, check_extras, load_now)
1101720
def __discoverPlugins():
    
    for app in settings.INSTALLED_APPS:
        if not app.startswith('django'):
            module = __import__(app)
            moduledir = path.Path(module.__file__).parent
            plugin = moduledir / 'frog_plugin.py'
            if plugin.exists():
                file_, fpath, desc = imp.find_module('frog_plugin', [moduledir])
                if file_:
                    imp.load_module('frog_plugin', file_, fpath, desc)

    return FrogPluginRegistry.plugins
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)
32668
def plugins(self):
        

        if self._plugins is None:
            self._plugins = {}

            for _, plugin in self.load_extensions('iotile.plugin'):
                links = plugin()
                for name, value in links:
                    self._plugins[name] = value

        return self._plugins
1070175
def get_plugins(modules, classes):
    
    for module in modules:
        for plugin in get_module_plugins(module, classes):
            yield plugin
583633
def GetPluginObjects(cls, plugin_names):
    
    plugin_objects = {}
    for plugin_name, plugin_class in iter(cls._plugin_classes.items()):
      if plugin_name not in plugin_names:
        continue

      plugin_objects[plugin_name] = plugin_class()

    return plugin_objects
71881
private void loadPlugins() {
		// Read the plugin class names from well known resources
		try {
			Enumeration<URL> pluginResources = classLoader.get().getResources(
					"META-INF/services/org.springsource.reloading.agent.Plugins");
			while (pluginResources.hasMoreElements()) {
				URL pluginResource = pluginResources.nextElement();
				if (GlobalConfiguration.isRuntimeLogging && log.isLoggable(Level.FINEST)) {
					log.finest("loadPlugins: TypeRegistry=" + this.toString() + ": loading plugin list file "
							+ pluginResource);
				}
				InputStream is = pluginResource.openStream();
				BufferedReader pluginClassNamesReader = new BufferedReader(new InputStreamReader(is));
				try {
					while (true) {
						String pluginName = pluginClassNamesReader.readLine();
						if (pluginName == null) {
							break;
						}
						if (!pluginName.startsWith("#")) {
							pluginClassNames.add(pluginName);
						}
					}
				}
				catch (IOException ioe) {
					// eof
				}
				is.close();
			}
		}
		catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		// Now load those plugins
		for (String pluginClassName : pluginClassNames) {
			if (GlobalConfiguration.isRuntimeLogging && log.isLoggable(Level.FINEST)) {
				log.finest("loadPlugins: TypeRegistry=" + this.toString() + ": loading plugin " + pluginClassName);
			}
			try {
				Class<?> pluginClass = Class.forName(pluginClassName, false, this.classLoader.get());
				Plugin pluginInstance = (Plugin) pluginClass.newInstance();
				localPlugins.add(pluginInstance);
			}
			catch (Exception e) {
				log.log(Level.WARNING, "Unable to find and instantiate plugin " + pluginClassName, e);
			}
		}
	}
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
768534
def discover_plugins(dirs):
    
    # Scan all subdirectories recursively.
    for path in _iter_plugin_files(dirs):
        filename = op.basename(path)
        subdir = op.dirname(path)
        modname, ext = op.splitext(filename)
        file, path, descr = imp.find_module(modname, [subdir])
        if file:
            # Loading the module registers the plugin in
            # IPluginRegistry.
            try:
                mod = imp.load_module(modname, file, path, descr)  # noqa
            except Exception as e:  # pragma: no cover
                logger.exception(e)
            finally:
                file.close()
    return IPluginRegistry.plugins
954066
def collect_plugins(self, modules=None):
        
        if modules is None:
            modules = self.get_loaded_modules()
        else:
            modules = util.return_list(modules)

        plugins = []
        for module in modules:
            module_plugins = [(item[1], item[0])
                              for item
                              in inspect.getmembers(module)
                              if item[1] and item[0] != '__builtins__']
            module_plugins, names = zip(*module_plugins)

            module_plugins = self._filter_modules(module_plugins, names)
            plugins.extend(module_plugins)
        return 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
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)
433083
def get_all_plugins(self):
        
        return [{
            "manifest": i,
            "plugin": self.get_plugin(i["name"]),
            "module": self.get_module(i["name"])
        } for i in self._manifests]
496400
def get_plugin(self, name):
        
        for plugin in self.plugins:
            if plugin.name == name:
                return plugin

        raise PluginDoesNotExistError("Plugin '{}' not found".format(name))