Package docutils :: Module utils
[show private | hide private]
[frames | no frames]

Module docutils.utils

Miscellaneous utilities for the documentation utilities.
Classes
ConditionSet A set of two thresholds (report_level & halt_level), a switch (debug), and an I/O stream (stream), corresponding to one Reporter category.
Reporter Info/warning/error reporter and system_message element generator.

Exceptions
BadOptionDataError  
BadOptionError  
DuplicateOptionError  
ExtensionOptionError  
NameValueError  
SystemMessage  

Function Summary
  assemble_option_dict(option_list, options_spec)
Return a mapping of option names to values.
  clean_rcs_keywords(paragraph, keyword_substitutions)
  extract_extension_options(field_list, options_spec)
Return a dictionary mapping extension option names to converted values.
  extract_name_value(line)
Return a list of (name, value) from a line of the form "name=value ...".
  extract_options(field_list)
Return a list of option (name, value) pairs from field names & bodies.
  get_source_line(node)
Return the "source" and "line" attributes from the node given or from its closest ancestor.
  new_document(source, settings)
Return a new empty document object.
  relative_path(source, target)
Build and return a path to target, relative to source (both files).

Function Details

assemble_option_dict(option_list, options_spec)

Return a mapping of option names to values.
Parameters:
option_list - A list of (name, value) pairs (the output of extract_options()).
options_spec - Dictionary mapping known option names to a conversion function such as int or float.

Exceptions:

  • KeyError for unknown option names.

  • DuplicateOptionError for duplicate options.

  • ValueError for invalid option values (raised by conversion

    function).

extract_extension_options(field_list, options_spec)

Return a dictionary mapping extension option names to converted values.
Parameters:
field_list - A flat field list without field arguments, where each field body consists of a single paragraph only.
options_spec - Dictionary mapping known option names to a conversion function such as int or float.

Exceptions:

  • KeyError for unknown option names.

  • ValueError for invalid option values (raised by the conversion

    function).

  • DuplicateOptionError for duplicate options.

  • BadOptionError for invalid fields.

  • BadOptionDataError for invalid option data (missing name, missing data, bad quotes, etc.).

extract_name_value(line)

Return a list of (name, value) from a line of the form "name=value ...".

extract_options(field_list)

Return a list of option (name, value) pairs from field names & bodies.
Raises:
BadOptionError - for invalid fields.
BadOptionDataError - for invalid option data (missing name, missing data, bad quotes, etc.).

get_source_line(node)

Return the "source" and "line" attributes from the node given or from its closest ancestor.

new_document(source, settings=None)

Return a new empty document object.

Parameters:

source : string
The path to or description of the source text of the document.
settings : optparse.Values object
Runtime settings. If none provided, a default set will be used.

relative_path(source, target)

Build and return a path to target, relative to source (both files).

If there is no common prefix, return the absolute path to target.


Generated by Epydoc 2.0 on Tue Jul 22 05:30:39 2003 http://epydoc.sf.net