class OptionParser(optparse.OptionParser, docutils.SettingsSpec): (source)
Settings 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 restricted to using long options. Deprecated. Will be replaced by a subclass of `argparse.ArgumentParser`.
Class Method | get |
Return list of config files, from environment or standard. |
Method | __init__ |
Set up OptionParser instance. |
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 |
Undocumented |
Method | populate |
Collect settings specification from components. |
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 without 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. |
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' `setting_specs`. Override in subclasses. |
Set up OptionParser instance. `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.
Collect settings specification from components. For each component, 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 without command-line option equivalents. See https://docutils.sourceforge.io/docs/user/config.html#internal-settings
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.