Package pyctags :: Module tag_file :: Class ctags_file
[hide private]
[frames] | no frames]

Class ctags_file

source code

Class that parses ctags generated files contains resulting ctags_entry objects.

Instance Methods [hide private]
 
__init__(self, tags=None, **kwargs)
Initializes instances of ctags_file.
source code
 
_clear_variables(self)
Sets internal maps to initial values.
source code
 
__header_format(self, line)
Processes !_ctags_file_FORMAT ctags header.
source code
 
__header_sorted(self, line)
Processes !_ctags_file_SORTED ctags header.
source code
 
__header_author(self, line)
Processes !_TAG_PROGRAM_AUTHOR ctags header.
source code
 
__header_name(self, line)
Processes !_TAG_PROGRAM_NAME ctags header.
source code
 
__header_url(self, line)
Processes !_TAG_PROGRAM_URL ctags header.
source code
 
__header_version(self, line)
Processes !_TAG_PROGRAM_VERSION ctags header.
source code
 
parse(self, tags, **kwargs)
Parses ctags file and constructs ctags_entry list.
source code
 
harvest(self, harvesters)
Used to perform new data harvesters with already processed tags.
source code
 
feed_init(self, **kwargs)
Initializes ctags_file data members and possible data harvesters.
source code
 
feed_line(self, tagline)
Used to parse new ctags formatted output and new tags to the end of the tags list.
source code
 
feed_finish(self)
Finalizes data harvesters from tag line feed.
source code
Class Variables [hide private]
  __HEADER_ITEMS = {'!_TAG_FILE_FORMAT': __header_format, '!_TAG...
Instance Variables [hide private]
  format
Format from the header.
  format_comment
Format header comment.
  sorted
Sorting type.
  sorted_comment
Sorting type comment.
  author
Ctags author.
  author_comment
Ctags author comment.
  name
Tag program name.
  name_comment
Tag program comment.
  url
Tag program url.
  url_comment
Tag program url comment.
  version
Tag program version.
  version_comment
Tag program version comment.
  tags
List of ctags_entry elements.
  __feed_harvesters
List of harvesters used when parsing ctags output on the fly.
Method Details [hide private]

__init__(self, tags=None, **kwargs)
(Constructor)

source code 

Initializes instances of ctags_file.

  • Keyword Arguments:
    • harvesters: (list) list of harvester classes
Parameters:
  • tags (sequence or str) - If tags is a sequence, it will automatically be parsed. If it is a filename or path, it will be opened and parsed.

parse(self, tags, **kwargs)

source code 

Parses ctags file and constructs ctags_entry list.

  • Keyword Arguments:
    • harvesters: (list) list of harvester classes
Parameters:
  • tags (sequence or str) - Filename or sequence of tag strings to parse.
Raises:
  • ValueError - parsing error

harvest(self, harvesters)

source code 

Used to perform new data harvesters with already processed tags.

Parameters:
  • harvesters (list) - harvester classes to apply to existing tags.
Raises:
  • ValueError - if no tag data is available to process.

feed_init(self, **kwargs)

source code 

Initializes ctags_file data members and possible data harvesters.

  • Keyword Arguments:
    • harvesters: (list) list of harvester classes
Raises:
  • ValueError - parsing error

feed_line(self, tagline)

source code 

Used to parse new ctags formatted output and new tags to the end of the tags list.

Parameters:
  • tagline (unicode str) - line from ctags output file

feed_finish(self)

source code 

Finalizes data harvesters from tag line feed. Drops references to harvesters.


Class Variable Details [hide private]

__HEADER_ITEMS

Value:
{'!_TAG_FILE_FORMAT': __header_format, '!_TAG_FILE_SORTED': __header_s\
orted, '!_TAG_PROGRAM_AUTHOR': __header_author, '!_TAG_PROGRAM_NAME': \
__header_name, '!_TAG_PROGRAM_URL': __header_url, '!_TAG_PROGRAM_VERSI\
ON': __header_version}