Return a list of available parsing modules
427754
def list_parsers(self, *args):
        """"""
        print('==== Available parsing modules: ====\n')
        for parser in sorted(self.parse_modules):
            print(self.parse_modules[parser].name.ljust(16) + \
                ': ' + self.parse_modules[parser].desc)
        sys.exit(0)
189647
def get_format_modules(lang=None, reverse=False):
    
    if lang is None:
        lang = get_language()
    modules = _format_modules_cache.setdefault(lang, list(
        iter_format_modules(lang)))
    if reverse:
        return list(reversed(modules))
    return modules
807075
def get_parser(cls):
        """"""
        organizer = cls()
        organizer.setup_parser()
        organizer._finish_parser()
        return organizer.parser
751169
def loadable_modules(self):
        ''''''
        with self._mutex:
            if not self._loadable_modules:
                self._loadable_modules = []
                for mp in self._obj.get_loadable_modules():
                    self._loadable_modules.append(utils.nvlist_to_dict(mp.properties))
        return self._loadable_modules
406194
def get_module_names(p):
    '''
    '''
    mods = list()
    mods = [f.split('.')[0] for f in listdir(p)
            if isfile(join(p, f)) and not f.endswith('.pyc') and not f.startswith('__')]
    print len(mods)
    return mods
443674
def get_module_classes(module):
    

    clslst = get_module_members(module, type=inspect.isclass)
    return list(filter(lambda cls: not issubclass(cls, Exception),
                       clslst))
455614
def get_module_parser(mod, modname, parents=[], add_help=True):
    
    return argparse.ArgumentParser(
        usage=configuration.EXECUTABLE_NAME + ' ' + modname + ' [options]',
        description=mod.get_description(), parents=parents,
        add_help=add_help)
374633
def _GetParsersFromPresetCategory(cls, category):
    
    preset_definition = cls._presets.GetPresetByName(category)
    if preset_definition is None:
      return []

    preset_names = cls._presets.GetNames()
    parser_names = set()

    for element_name in preset_definition.parsers:
      if element_name in preset_names:
        category_parser_names = cls._GetParsersFromPresetCategory(element_name)
        parser_names.update(category_parser_names)
      else:
        parser_names.add(element_name)

    return sorted(parser_names)
982921
def modules(cls):
        
        members = inspect.getmembers(cls, lambda a: not (inspect.isroutine(a) and a.__name__ == 'modules'))
        modules = [module for name, module in members if not name.startswith('_')]
        return modules
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
597111
def modules():
    '''
    
    '''
    cmd = '{0} -M'.format(_detect_os())
    ret = {}
    ret['static'] = []
    ret['shared'] = []
    out = __salt__['cmd.run'](cmd).splitlines()
    for line in out:
        comps = line.split()
        if not comps:
            continue
        if '(static)' in line:
            ret['static'].append(comps[0])
        if '(shared)' in line:
            ret['shared'].append(comps[0])
    return ret
1000592
def _get_module(self, line):
        """"""
        #Finding the module name is trivial; start at the beginning of
        #the module and iterate lines until we find the module.
        for sline in self._source:
            if len(sline) > 0 and sline[0] != "!":
                rmatch = self.RE_MODULE.match(sline)
                if rmatch is not None:
                    self.modulename = rmatch.group("name")
                    break
        else:
            #We don't even have the start of a module in this code file
            return
            
        #Before we carry on with the rest of the context, find the separating
        #CONTAINS keyword so we know whether to look for types or subs/funcs.
        #If the code parser hasn't ever parsed this module, parse it now.
        self.parser.isense_parse(self._orig_path, self.modulename)
        self.module = self.parser.modules[self.modulename]

        if line > self.module.contains_index:
            self.section = "contains"
14507
def get_base_modules():
    "  "

    return sorted(filter(
                  lambda x: op.isdir(op.join(MOD_DIR, x)),
                  listdir(MOD_DIR)))
306960
function getModuleDefinitions(modules) {
      return modules.split(',').map(function(md) {
        var split = md.split(':'), name, path, type;
        name = split[0];
        path = './' + name.toLowerCase();
        if (name === 'Locales') {
          type = 'locales';
        } else if (moduleIsPolyfill(name)) {
          type = 'polyfill';
        } else {
          type = 'module';
        }
        return {
          name: name,
          path: path,
          type: type,
          namespace: split[1]
        };
      });
    }
268114
def GetParserAndPluginNames(cls, parser_filter_expression=None):
    
    parser_and_plugin_names = []
    for parser_name, parser_class in cls.GetParsers(
        parser_filter_expression=parser_filter_expression):
      parser_and_plugin_names.append(parser_name)

      if parser_class.SupportsPlugins():
        for plugin_name, _ in parser_class.GetPlugins():
          parser_and_plugin_names.append(
              '{0:s}/{1:s}'.format(parser_name, plugin_name))

    return parser_and_plugin_names
1268162
def get_modules(modulepath):
    """"""
    m = importlib.import_module(modulepath)
    mpath = m.__file__
    ret = set([m])

    if "__init__." in mpath.lower():
        mpath = os.path.dirname(mpath)

        # https://docs.python.org/2/library/pkgutil.html#pkgutil.iter_modules
        for module_info in pkgutil.iter_modules([mpath]):
            submodulepath = ".".join([modulepath, module_info[1]])
            if module_info[2]:
                # module is a package
                submodules = get_modules(submodulepath)
                ret.update(submodules)
            else:
                ret.add(importlib.import_module(submodulepath))

    return ret
207650
def ListParsersAndPlugins(self):
    """"""
    parsers_information = parsers_manager.ParsersManager.GetParsersInformation()

    table_view = views.ViewsFactory.GetTableView(
        self._views_format_type, column_names=['Name', 'Description'],
        title='Parsers')

    for name, description in sorted(parsers_information):
      table_view.AddRow([name, description])
    table_view.Write(self._output_writer)

    parser_names = parsers_manager.ParsersManager.GetNamesOfParsersWithPlugins()
    for parser_name in parser_names:
      plugins_information = (
          parsers_manager.ParsersManager.GetParserPluginsInformation(
              parser_filter_expression=parser_name))

      table_title = 'Parser plugins: {0:s}'.format(parser_name)
      table_view = views.ViewsFactory.GetTableView(
          self._views_format_type, column_names=['Name', 'Description'],
          title=table_title)
      for name, description in sorted(plugins_information):
        table_view.AddRow([name, description])
      table_view.Write(self._output_writer)

    title = 'Parser presets'
    if self._presets_file:
      source_path = os.path.dirname(os.path.dirname(os.path.dirname(
          os.path.abspath(__file__))))

      presets_file = self._presets_file
      if presets_file.startswith(source_path):
        presets_file = presets_file[len(source_path) + 1:]

      title = '{0:s} ({1:s})'.format(title, presets_file)

    presets_information = parsers_manager.ParsersManager.GetPresetsInformation()

    table_view = views.ViewsFactory.GetTableView(
        self._views_format_type, column_names=['Name', 'Parsers and plugins'],
        title=title)
    for name, description in sorted(presets_information):
      table_view.AddRow([name, description])
    table_view.Write(self._output_writer)