class OptionParser(optparse.OptionParser, docutils.SettingsSpec): (source)
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_args |
Undocumented |
Method | check_values |
Store positional arguments as runtime settings. |
Method | get_config_file_settings |
Returns a dictionary containing appropriate config file settings. |
Method | get_default_values |
Needed to get custom Values instances. |
Method | get_option_by_dest |
Get an option by its dest. |
Method | get_standard_config_files |
Return list of config files, from environment or standard. |
Method | get_standard_config_settings |
Undocumented |
Method | populate_from_components |
No summary |
Method | set_defaults_from_dict |
Undocumented |
Class Variable | booleans |
Lookup table for boolean configuration file settings. |
Class Variable | config_section |
The name of the config file section specific to this component (lowercase, no brackets). Override in subclasses. |
Class Variable | default_error_encoding |
Undocumented |
Class Variable | default_error_encoding_error_handler |
Undocumented |
Class Variable | settings_defaults |
Defaults for settings that don't have command-line option equivalents. |
Class Variable | 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() ). |
Class Variable | standard_config_files |
Docutils configuration files, using ConfigParser syntax. Filenames will be tilde-expanded later. Later files override earlier ones. |
Class Variable | threshold_choices |
Possible inputs for for --report and --halt threshold values. |
Class Variable | thresholds |
Lookup table for --report and --halt threshold values. |
Class Variable | version_template |
Default version message. |
Instance Variable | components |
Undocumented |
Instance Variable | config_files |
List of paths of applied configuration files. |
Instance Variable | lists |
Set of list-type settings. |
Instance Variable | relative_path_settings |
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_section_dependencies |
No summary |
Class Variable | settings_default_overrides |
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.
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
docutils.SettingsSpec.settings_defaults
docutils.SettingsSpec.settings_spec
populate_from_components()
).