Package pyctags :: Module exuberant :: Class exuberant_ctags
[hide private]
[frames] | no frames]

Class exuberant_ctags

source code

tag_base.ctags_base --+
                      |
                     exuberant_ctags

Wraps the Exuberant Ctags program. http://ctags.sourceforge.net

The generate_tags and generate_tagfile methods will accept custom command line parameters for exuberant ctags via the generator_options keyword dict. The Exuberant Ctags output flags (-f and -o) are reserved for internal use and will trigger an exception.

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
Wraps the Exuberant Ctags program.
source code
 
__process_kinds_list(self, kinds_list)
Slice n dice the --list-kinds output from exuberant ctags.
source code
 
_query_tag_generator(self, path)
Gets Exuberant Ctags program information.
source code
str
_dict_to_args(self, gen_opts)
Converts from a dict with command line arguments to a string to feed exuberant ctags on the comand line.
source code
 
_prepare_to_generate(self, kw)
Prepares parameters to be passed to exuberant ctags.
source code
list
generate_tags(self, **kwargs)
Parses source files into list of tags.
source code
boolean
generate_tagfile(self, output_file, **kwargs)
Generates tag file from list of files.
source code
(ctags_file or None)
generate_object(self, **kwargs)
Parses source files into a ctags_file instance.
source code

Inherited from tag_base.ctags_base: ctags_executable, input_files

Class Variables [hide private]
  __version_opt = '--version'
  __list_kinds_opt = '--list-kinds'
  __argless_args = ['--version', '--help', '--license', '--list-...
  __default_opts = {'-L': '-', '-f': '-'}
  __exuberant_id = 'exuberant ctags'
  __supported_versions = ['5.7', '5.6b1']
  __warning_str = ': Warning:'
Instance Variables [hide private]
  version
Exuberant ctags version number.
  language_info
Exuberant ctags supported language parsing features.

Inherited from tag_base.ctags_base: command_line, warnings

Inherited from tag_base.ctags_base (private): _executable_path, _file_list

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 

Wraps the Exuberant Ctags program.

  • Keyword Arguments:
    • tag_program: (str) path to ctags executable, or name of a ctags program in path
    • files: (sequence) files to process with ctags
Overrides: tag_base.ctags_base.__init__

_query_tag_generator(self, path)

source code 

Gets Exuberant Ctags program information.

Raises:
  • ValueError - No valid ctags executable set.
  • TypeError - Executable is not Exuberant Ctags.
Overrides: tag_base.ctags_base._query_tag_generator

_dict_to_args(self, gen_opts)

source code 

Converts from a dict with command line arguments to a string to feed exuberant ctags on the comand line.

Parameters:
  • gen_opts (dict) - command line arguments, key=argument, value=setting
Returns: str

_prepare_to_generate(self, kw)

source code 

Prepares parameters to be passed to exuberant ctags.

Returns:
tuple (generator_options_dict, files_str)

generate_tags(self, **kwargs)

source code 

Parses source files into list of tags.

  • Keyword Arguments:
    • tag_program: (str) path to ctags executable, or name of a ctags program in path
    • files: (sequence) files to process with ctags
    • generator_options: (dict) command-line options to pass to ctags program
Returns: list
strings output by exuberant ctags
Raises:
  • ValueError - ctags executable path not set, fails execution
Overrides: tag_base.ctags_base.generate_tags

generate_tagfile(self, output_file, **kwargs)

source code 

Generates tag file from list of files.

  • Keyword Arguments:
    • tag_program: (str) path to ctags executable, or name of a ctags program in path
    • files: (sequence) files to process with ctags
    • generator_options: (dict) options to pass to ctags program
Parameters:
  • output_file (str) - File name and location to write tagfile.
Returns: boolean
file written
Raises:
  • ValueError - ctags executable path not set or output file isn't valid
Overrides: tag_base.ctags_base.generate_tagfile

generate_object(self, **kwargs)

source code 

Parses source files into a ctags_file instance. This method exists to avoid storing ctags generated data in an intermediate form before parsing.

According to python documentation, this mechanism could deadlock due to other OS pipe buffers filling and blocking the child process. http://docs.python.org/library/subprocess.html

  • Keyword Arguments:
    • tag_program: (str) path to ctags executable, or name of a ctags program in path
    • files: (sequence) files to process with ctags
    • generator_options: (dict) options to pass to ctags program
    • harvesters: (list) list of harvester data classes for ctags_file to use while parsing
Returns: (ctags_file or None)
generated instance of ctags_file on success, None on failure
Raises:
  • ValueError - ctags executable path not set

Class Variable Details [hide private]

__argless_args

Value:
['--version',
 '--help',
 '--license',
 '--list-languages',
 '-a',
 '-B',
 '-e',
 '-F',
...