3
T'ícÒ ã @ sÈ d Z dZddlZddlZddlZddlZddlZddlZddlmZ ej d8krhddl
mZ ddlmZ nddl
mZ ddlmZ ddlZddlZddlZdd lmZmZmZmZ ej d9kr¾eZd
d Zdd
Zd:ddZd;ddZd<ddZd=ddZd>ddZd?ddZ d@ddZ!dAddZ"dBddZ#dCd d!Z$dDd"d#Z%dEd$d%Z&dFd&d'Z'dGd(d)Z(d*d+ Z)d,d- Z*G d.d/ d/ej+Z+G d0d1 d1ej,Z,G d2d3 d3ej-ej.Z-G d4d5 d5eZ
G d6d7 d7e/Z0dS )Hau
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:
* Option callbacks: `store_multiple`, `read_config_file`.
* Setting validators: `validate_encoding`,
`validate_encoding_error_handler`,
`validate_encoding_and_error_handler`,
`validate_boolean`, `validate_ternary`, `validate_threshold`,
`validate_colon_separated_list`,
`validate_comma_separated_list`,
`validate_dependency_file`.
* `make_paths_absolute`.
* SettingSpec manipulation: `filter_settings_spec`.
ZreStructuredTexté N)Ú
SUPPRESS_HELPé )ÚRawConfigParser)Úgetcwd)Úgetcwdu)Úlocale_encodingÚ
SafeStringÚErrorOutputÚErrorStringc O sD x|D ]}t |j|d qW x"|j D ]\}}t |j|| q&W dS )zÀ
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`.
N)ÚsetattrÚvaluesÚitems)ÚoptionÚoptÚvalueÚparserÚargsÚkwargsÚ attributeÚkey© r ú5/tmp/pip-build-gk9425m9/docutils/docutils/frontend.pyÚstore_multiple8 s
r c C sN y|j |}W n, tk
r: } z|j| W Y dd}~X nX |jj|| dS )zQ
Read a configuration file during option processing. (Option callback.)
N)Úget_config_file_settingsÚ
ValueErrorÚerrorr Úupdate)r r r r Znew_settingsr r r r Úread_config_fileD s