Get installed banana plugins.

        :return: dictionary of installed generators name: distribution
353814
def _get_generators(self):
        
        # on using entrypoints:
        # http://stackoverflow.com/questions/774824/explain-python-entry-points
        # TODO: make sure we do not have conflicting generators installed!
        generators = [ep.name for ep in
                      pkg_resources.iter_entry_points(self.group)]
        return generators
639273
def _GetPluginData(self):
    
    return_dict = {}

    return_dict['Versions'] = [
        ('plaso engine', plaso.__version__),
        ('python', sys.version)]

    hashers_information = hashers_manager.HashersManager.GetHashersInformation()
    parsers_information = parsers_manager.ParsersManager.GetParsersInformation()
    plugins_information = (
        parsers_manager.ParsersManager.GetParserPluginsInformation())
    presets_information = parsers_manager.ParsersManager.GetPresetsInformation()

    return_dict['Hashers'] = hashers_information
    return_dict['Parsers'] = parsers_information
    return_dict['Parser Plugins'] = plugins_information
    return_dict['Parser Presets'] = presets_information

    return return_dict
216154
def plugins(self):
        
        from fluent_contents import extensions   # Avoid circular reference because __init__.py imports subfolders too
        if self._plugins is None:
            return extensions.plugin_pool.get_plugins()
        else:
            return extensions.plugin_pool.get_plugins_by_name(*self._plugins)
441301
def get_plugins(**kwargs):
    
    
    plugins = []
    plugin_paths = []
    
    #Look in directory or set of directories for
    #plugins
    
    base_plugin_dir = config.get('plugin', 'default_directory')
    plugin_xsd_path = config.get('plugin', 'plugin_xsd_path')

    base_plugin_dir_contents = os.listdir(base_plugin_dir)
    for directory in base_plugin_dir_contents:
        #ignore hidden files
        if directory[0] == '.' or directory == 'xml':
            continue

        #Is this a file or a directory? If it's a directory, it's a plugin.
        path = os.path.join(base_plugin_dir, directory)
        if os.path.isdir(path):
            plugin_paths.append(path)
   

    #For each plugin, get its details (an XML string)
    
    #Retrieve the xml schema for validating the XML to make sure
    #what is being provided  to the IU is correct.
    xmlschema_doc = etree.parse(plugin_xsd_path)
                    
    xmlschema = etree.XMLSchema(xmlschema_doc)
    
    #Get the xml description file from the plugin directory. If there
    #is no xml file, the plugin in unusable.
    for plugin_dir in plugin_paths:
        full_plugin_path = os.path.join(plugin_dir, 'trunk')
        
        dir_contents = os.listdir(full_plugin_path)
        #look for a plugin.xml file in the plugin directory 
        for file_name in dir_contents:
            file_path = os.path.join(full_plugin_path, file_name)
            if file_name == 'plugin.xml':
                
                f = open(file_path, 'r')
                
                #validate the xml using the xml schema for defining
                #plugin details
                try:
                    y = open(file_path, 'r')
                    
                    xml_tree = etree.parse(y)

                    xmlschema.assertValid(xml_tree)
                   
                    plugins.append(etree.tostring(xml_tree))
                except Exception as e:
                    log.critical("Schema %s did not validate! (error was %s)"%(file_name, e))

                break
        else:
            log.warning("No xml plugin details found for %s. Ignoring", plugin_dir)

    return plugins
711646
def _get_plugin_dirs():
    
    plugin_dirs = [
        os.path.expanduser(os.path.join(USER_CONFIG_DIR, "plugins")),
        os.path.join("rapport", "plugins")  # Local dev tree
    ]
    return plugin_dirs
616150
def get_plugin_classes(modules):
    """"""
    classes = (_ConnectionPlugin, _ContentPlugin, _ParserPlugin)
    return loader.get_plugins(modules, classes)
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
853733
def get_plugins(metadata):
    
    plugins = load_plugins()
    if not plugins:
        raise NoPluginsError('No plugins found')

    results = []
    for p in sorted(plugins.get_all(), key=attrgetter('name')):
        if metadata:
            data = {'name': p.name, 'homepage': p.homepage}
            hints = getattr(p, 'hints', [])
            if hints:
                data['hints'] = hints
            results.append(data)
        else:
            results.append(p.name)
    return results
1196738
def get_installed_plugins():
    
    return {
        # Strip the first five characters from the plugin name since all
        # plugins are expected to start with `taxi-`
        backend.dist.project_name[5:]: backend.dist.version
        for backend in backends_registry._entry_points.values()
        if backend.dist.project_name != 'taxi'
    }
1355510
def get_dependants(cls, dist):
        """"""
        for package in cls.installed_distributions:
            for requirement_package in package.requires():
                requirement_name = requirement_package.project_name
                # perform case-insensitive matching
                if requirement_name.lower() == dist.lower():
                    yield package
247135
def GetPlugins(cls):
    
    for plugin_name, plugin_class in iter(cls._plugin_classes.items()):
      yield plugin_name, plugin_class
171772
def _get_template_dirs(type="plugin"):
    
    template_dirs = [
        os.path.expanduser(os.path.join(USER_CONFIG_DIR, "templates", type)),
        os.path.join("rapport", "templates", type)  # Local dev tree
    ]
    return template_dirs
466633
def _get_plugins_by_entry_points(self):
        
        # Let's find and register every plugin, which is in sys.path and has defined a entry_point 'groundwork.plugin'
        # in it's setup.py
        entry_points = []
        classes = {}
        for entry_point in iter_entry_points(group='groundwork.plugin', name=None):
            entry_points.append(entry_point)

        for entry_point in entry_points:
            try:
                entry_point_object = entry_point.load()
            except Exception as e:
                # We should not throw an exception now, because a package/entry_point can be outdated, using an old
                # api from groundwork, tries to import unavailable packages, what ever...
                # We just do not make it available. That's all we can do.
                self._log.debug("Couldn't load entry_point %s. Reason: %s" % (entry_point.name, e))
                continue

            if not issubclass(entry_point_object, GwBasePattern):
                self._log.warning("entry_point  %s is not a subclass of groundworkPlugin" % entry_point.name)
                continue
            plugin_name = entry_point_object.__name__

            plugin_class = self.register_class(entry_point_object, plugin_name,
                                               entrypoint_name=entry_point.name,
                                               distribution_path=entry_point.dist.location,
                                               distribution_key=entry_point.dist.key,
                                               distribution_version=entry_point.dist.version)

            classes[plugin_name] = plugin_class
            # classes[plugin_name] = {
            #     "name": plugin_name,
            #     "entry_point": entry_point.name,
            #     "path": entry_point.dist.location,
            #     "class": entry_point_object,
            #     "distribution": {
            #         "key": entry_point.dist.key,
            #         "version": entry_point.dist.version
            #     },
            # }
            self._log.debug("Found plugin: %s at entry_point %s of package %s (%s)" % (plugin_name, entry_point.name,
                                                                                       entry_point.dist.key,
                                                                                       entry_point.dist.version))
        return classes
1353112
def _get_rabbitmq_plugin():
    '''
    
    '''
    global RABBITMQ_PLUGINS

    if RABBITMQ_PLUGINS is None:
        version = __salt__['pkg.version']('rabbitmq-server').split('-')[0]
        RABBITMQ_PLUGINS = ('/usr/lib/rabbitmq/lib/rabbitmq_server-{0}'
                            '/sbin/rabbitmq-plugins').format(version)

    return RABBITMQ_PLUGINS
1031147
def pluginNames(cls, enabled=True):
        
        return map(lambda x: x.name(), cls.plugins(enabled))
636535
def _get_files(self):
        
        excludes = [
            '.git',
            '.tox',
            '.vagrant',
            '.venv',
            os.path.basename(self._config.verifier.directory),
        ]
        generators = [
            util.os_walk(self._config.project_directory, '*.yml', excludes),
            util.os_walk(self._config.project_directory, '*.yaml', excludes),
        ]

        return [f for g in generators for f in g]
1334245
def find_providers():
    """"""
    providers_list = sorted({modname for (_, modname, _)
                             in pkgutil.iter_modules(providers.__path__)
                             if modname != 'base'})

    try:
        distribution = pkg_resources.get_distribution('dns-lexicon')
    except pkg_resources.DistributionNotFound:
        return {provider: True for provider in providers_list}
    else:
        return {provider: _resolve_requirements(provider, distribution)
                for provider in providers_list}