class OptionParser(optparse.OptionParser, docutils.SettingsSpec): (source)
Constructor: OptionParser(components, defaults, read_config_files, *args, **kwargs)
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.
Common settings (defined below) and component-specific settings must not conflict. Short options are reserved for common settings, and components are restrict to using long options.
Method | __init__ |
components is a list of Docutils components each containing a .settings_spec attribute. defaults is a mapping of setting default overrides. |
Method | check |
Undocumented |
Method | check |
Store positional arguments as runtime settings. |
Method | get |
Returns a dictionary containing appropriate config file settings. |
Method | get |
Needed to get custom Values instances. |
Method | get |
Get an option by its dest. |
Method | get |
Return list of config files, from environment or standard. |
Method | get |
Undocumented |
Method | populate |
For each component, first populate from the SettingsSpec.settings_spec structure, then from the SettingsSpec.settings_defaults dictionary. After all components have been processed, check for and populate from each component's ... |
Method | set |
Undocumented |
Class Variable | booleans |
Lookup table for boolean configuration file settings. |
Class Variable | config |
The name of the config file section specific to this component (lowercase, no brackets). Override in subclasses. |
Class Variable | default |
Undocumented |
Class Variable | default |
Undocumented |
Class Variable | settings |
Defaults for settings that don't have command-line option equivalents. |
Class Variable | settings |
Runtime settings and command-line options common to all Docutils front ends. Setting specs specific to individual Docutils components are also used (see populate_from_components() ). |
Class Variable | standard |
Docutils configuration files, using ConfigParser syntax. Filenames will be tilde-expanded later. Later files override earlier ones. |
Class Variable | threshold |
Possible inputs for for --report and --halt threshold values. |
Class Variable | thresholds |
Lookup table for --report and --halt threshold values. |
Class Variable | version |
Default version message. |
Instance Variable | components |
Undocumented |
Instance Variable | config |
List of paths of applied configuration files. |
Instance Variable | lists |
Set of list-type settings. |
Instance Variable | relative |
Settings containing filesystem paths. Override in subclasses. Settings listed here are to be interpreted relative to the current working directory. |
Instance Variable | version |
Undocumented |
Inherited from SettingsSpec
:
Class Variable | config |
A list of names of config file sections that are to be applied before config_section , in order (from general to specific). In other words, the settings in config_section are to be overlaid on top of the settings from these sections... |
Class Variable | settings |
A dictionary of auxiliary defaults, to override defaults for settings defined in other components. Override in subclasses. |
components
is a list of Docutils components each containing a
.settings_spec attribute. defaults
is a mapping of setting
default overrides.
Get an option by its dest.
If you're supplying a dest which is shared by several options, it is undefined which option of those is returned.
A KeyError is raised if there is no option with the supplied dest.
For each component, first populate from the SettingsSpec.settings_spec
structure, then from the SettingsSpec.settings_defaults
dictionary.
After all components have been processed, check for and populate from
each component's SettingsSpec.settings_default_overrides
dictionary.
docutils.SettingsSpec.config_section
The name of the config file section specific to this component (lowercase, no brackets). Override in subclasses.
docutils.SettingsSpec.settings_defaults
Defaults for settings that don't have command-line option equivalents.
docutils.SettingsSpec.settings_spec
Runtime settings and command-line options common to all Docutils front
ends. Setting specs specific to individual Docutils components are also
used (see populate_from_components()
).
Docutils configuration files, using ConfigParser syntax. Filenames will be tilde-expanded later. Later files override earlier ones.