module documentation
(source)

Command-line and common processing for Docutils front-end tools.

Exports the following classes:

  • OptionParser: Standard Docutils command-line processing.
  • Option: Customized version of optparse.Option; validation support.
  • Values: Runtime settings; objects are simple structs (object.attribute). Supports cumulative list settings (attributes).
  • ConfigParser: Standard Docutils config file processing.

Also exports the following functions:

Class ​Config​Deprecation​Warning Warning for deprecated configuration file features.
Class ​Config​Parser No class docstring; 2/2 instance variables, 1/3 class variable, 3/6 methods documented
Class ​Option No class docstring; 0/1 constant, 1/1 method documented
Class ​Option​Parser Parser for command-line and library use. The settings_spec specification here and in other Docutils components are merged to build the set of command-line options and runtime settings for this process.
Class ​Values Updates list attributes by extension rather than by replacement. Works in conjunction with the OptionParser.lists instance attribute.
Function filter​_settings​_spec Return a copy of settings_spec excluding/replacing some settings.
Function make​_one​_path​_absolute Undocumented
Function make​_paths​_absolute Interpret filesystem path settings relative to the base_path given.
Function read​_config​_file Read a configuration file during option processing. (Option callback.)
Function store​_multiple Store multiple values in parser.values. (Option callback.)
Function validate​_boolean Check/normalize boolean settings: True: '1', 'on', 'yes', 'true' False: '0', 'off', 'no','false', ''
Function validate​_colon​_separated​_string​_list Undocumented
Function validate​_comma​_separated​_list Check/normalize list arguments (split at "," and strip whitespace).
Function validate​_dependency​_file Undocumented
Function validate​_encoding Undocumented
Function validate​_encoding​_and​_error​_handler Side-effect: if an error handler is included in the value, it is inserted into the appropriate place as if it was a separate setting/option.
Function validate​_encoding​_error​_handler Undocumented
Function validate​_nonnegative​_int Undocumented
Function validate​_smartquotes​_locales Check/normalize a comma separated list of smart quote definitions.
Function validate​_strip​_class Undocumented
Function validate​_ternary No summary
Function validate​_threshold Undocumented
Function validate​_url​_trailing​_slash Undocumented
def filter_settings_spec(settings_spec, *exclude, **replace): (source)

Return a copy of settings_spec excluding/replacing some settings.

settings_spec is a tuple of configuration settings with a structure described for docutils.SettingsSpec.settings_spec.

Optional positional arguments are names of to-be-excluded settings. Keyword arguments are option specification replacements. (See the html4strict writer for an example.)

def make_one_path_absolute(base_path, path): (source)

Undocumented

def make_paths_absolute(pathdict, keys, base_path=None): (source)

Interpret filesystem path settings relative to the base_path given.

Paths are values in pathdict whose keys are in keys. Get keys from OptionParser.relative_path_settings.

def read_config_file(option, opt, value, parser): (source)
Read a configuration file during option processing. (Option callback.)
def store_multiple(option, opt, value, parser, *args, **kwargs): (source)

Store multiple values in parser.values. (Option callback.)

Store None for each attribute named in args, and store the value for each key (attribute name) in kwargs.

def validate_boolean(setting, value, option_parser, config_parser=None, config_section=None): (source)
Check/normalize boolean settings: True: '1', 'on', 'yes', 'true' False: '0', 'off', 'no','false', ''
def validate_colon_separated_string_list(setting, value, option_parser, config_parser=None, config_section=None): (source)

Undocumented

def validate_comma_separated_list(setting, value, option_parser, config_parser=None, config_section=None): (source)
Check/normalize list arguments (split at "," and strip whitespace).
def validate_dependency_file(setting, value, option_parser, config_parser=None, config_section=None): (source)

Undocumented

def validate_encoding(setting, value, option_parser, config_parser=None, config_section=None): (source)

Undocumented

def validate_encoding_and_error_handler(setting, value, option_parser, config_parser=None, config_section=None): (source)
Side-effect: if an error handler is included in the value, it is inserted into the appropriate place as if it was a separate setting/option.
def validate_encoding_error_handler(setting, value, option_parser, config_parser=None, config_section=None): (source)

Undocumented

def validate_nonnegative_int(setting, value, option_parser, config_parser=None, config_section=None): (source)

Undocumented

def validate_smartquotes_locales(setting, value, option_parser, config_parser=None, config_section=None): (source)

Check/normalize a comma separated list of smart quote definitions.

Return a list of (language-tag, quotes) string tuples.

def validate_strip_class(setting, value, option_parser, config_parser=None, config_section=None): (source)

Undocumented

def validate_ternary(setting, value, option_parser, config_parser=None, config_section=None): (source)
Check/normalize three-value settings: True: '1', 'on', 'yes', 'true' False: '0', 'off', 'no','false', '' any other value: returned as-is.
def validate_threshold(setting, value, option_parser, config_parser=None, config_section=None): (source)

Undocumented

def validate_url_trailing_slash(setting, value, option_parser, config_parser=None, config_section=None): (source)

Undocumented