
    N&ȋ                     4   d Z dZddlZddlZddlZddlZddlZddlZddlmZ ej	        dk    rddl
mZ ddlmZ nddlmZ ddlmZ ddlZddlZddlZdd	lmZmZmZmZ ej	        dk    reZd
 Zd Z	 d&dZ	 d&dZ	 d&dZ	 d&dZ	 d&dZ	 d&dZ 	 d&dZ!	 d&dZ"	 d&dZ#	 d&dZ$	 d&dZ%	 d&dZ&	 d&dZ'd'dZ(d Z)d Z* G d dej+                  Z+ G d dej,                  Z, G d  d!ej-        ej.                  Z- G d" d#e          Z G d$ d%e/          Z0dS )(au  
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`.
reStructuredText    N)SUPPRESS_HELP   r   )RawConfigParser)getcwd)getcwdu)locale_encoding
SafeStringErrorOutputErrorStringc                     |D ]}t          |j        |d           |                                D ]\  }}t          |j        ||           dS )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keys           ^/home/geonatureadmin/si_en_reseau/tutos/venv/lib/python3.11/site-packages/docutils/frontend.pystore_multipler   8   sf      0 0	y$////llnn + +
UsE****+ +    c                     	 |                     |          }n,# t          $ r}|                    |           Y d}~nd}~ww xY w|j                            ||           dS )zQ
    Read a configuration file during option processing.  (Option callback.)
    N)get_config_file_settings
ValueErrorerrorr   update)r   r   r   r   new_settingsr    s         r   read_config_filer#   D   sz    66u==   U
Mv.....s    
A<Ac                 z    	 t          j        |           n$# t          $ r t          d| d|d          w xY w|S )Nz	setting "z": unknown encoding: "")codecslookupLookupErrorsettingr   option_parserconfig_parserconfig_sections        r   validate_encodingr.   N   sb    .e . . .k$WWeee- . . 	.. Ls    !8c                 r    	 t          j        |           n # t          $ r t          d|z            w xY w|S )Nzunknown encoding error handler: "%s" (choices: "strict", "ignore", "replace", "backslashreplace", "xmlcharrefreplace", and possibly others; see documentation for the Python ``codecs`` module))r&   lookup_errorr(   r)   s        r   validate_encoding_error_handlerr1   W   s^    5E"""" 5 5 5, /445 5 	55 Ls    4c                    d|v re|                     d          \  }}t          | dz   ||||           |r|                    || dz   |           nt          |j        | dz   |           n|}t          | ||||           |S )z
    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.
    :_error_handler)splitr1   setr   r   r.   )r*   r   r+   r,   r-   encodinghandlers          r   #validate_encoding_and_error_handlerr9   c   s     e||!KK,,''&&>	+ 	+ 	+  	Ong8H.H%' ' ' ' M('4D*DgNNNNgx#^5 5 5Or   c                     t          |t                    r|S 	 |j        |                                                                         S # t
          $ r t          d|z            w xY w)z|Check/normalize boolean settings:
         True:  '1', 'on', 'yes', 'true'
         False: '0', 'off', 'no','false', ''
    zunknown boolean value: "%s")
isinstanceboolbooleansstriplowerKeyErrorr(   r)   s        r   validate_booleanrA   y   sv     % A%ekkmm&9&9&;&;<< A A A7%?@@@As   0A
 
A'c                     t          |t                    s||S 	 |j        |                                                                         S # t
          $ r |cY S w xY w)zCheck/normalize three-value settings:
         True:  '1', 'on', 'yes', 'true'
         False: '0', 'off', 'no','false', ''
         any other value: returned as-is.
    )r;   r<   r=   r>   r?   r@   r)   s        r   validate_ternaryrC      sj     % %-%ekkmm&9&9&;&;<<   s   0A AAc                 N    t          |          }|dk     rt          d          |S )Nr   z(negative value; must be positive or zero)intr   r)   s        r   validate_nonnegative_intrF      s*    JJEqyyCDDDLr   c                     	 t          |          S # t          $ rJ 	 |j        |                                         cY S # t          t
          f$ r t          d|z            w xY ww xY w)Nzunknown threshold: %r.)rE   r   
thresholdsr?   r@   AttributeErrorr(   r)   s        r   validate_thresholdrJ      s    @5zz @ @ @	@ +EKKMM::::.) 	@ 	@ 	@6>???	@@s    
A%=A%$A!!A%c                     t          |t                    s|                    d          }n<|                                }|                    |                    d                     |S )Nr3   )r;   listr5   popextend)r*   r   r+   r,   r-   lasts         r   $validate_colon_separated_string_listrP      sU    eT"" &C  yy{{TZZ__%%%Lr   c                     t          |t                    s|g}|                                }d |                    d          D             }|                    |           |S )zHCheck/normalize list arguments (split at "," and strip whitespace).
    c                 b    g | ],}|                     d           |                     d           -S )z 	
r>   ).0is     r   
<listcomp>z1validate_comma_separated_list.<locals>.<listcomp>   s5    NNN1AGGH<M<MNQWWXNNNr   ,)r;   rL   rM   r5   rN   )r*   r   r+   r,   r-   rO   r   s          r   validate_comma_separated_listrX      sb     eT""  99;;DNN

4(8(8NNNE	LLLr   c                 B    |sdS |                     d          r|S |dz   S )Nz.//)endswithr)   s        r   validate_url_trailing_slashr\      s2     t			 s{r   c                     	 t           j                            |          S # t          $ r" t           j                            d           cY S w xY wN)docutilsutilsDependencyListIOErrorr)   s        r   validate_dependency_filerc      sT    3~,,U333 3 3 3~,,T222223s   ! )AAc                     t          | ||||          }|D ]=}t          j                            |          }||k    rt	          d|d|d          >|S )NzInvalid class value z
 (perhaps z?))rX   r_   nodesmake_idr   )r*   r   r+   r,   r-   cls
normalizeds          r   validate_strip_classri      s     *'5-*7I IE  2 2^++C00
** #ZZZ1 2 2 2  Lr   c           	      :   t          | ||||          }g }|D ]}	 |                    dd          \  }}nT# t          $ r |                    |           Y ?t          $ r' t	          d|                    dd          z            w xY w|                                }|                    d          }	t          |	          dk    r|	}n9t          |          dk    r&t	          d|                    dd          z            |                    ||f           |S )z~Check/normalize a comma separated list of smart quote definitions.

    Return a list of (language-tag, quotes) string tuples.r3      z4Invalid value "%s". Format is "<language>:<quotes>".asciibackslashreplace   z[Invalid value "%s". Please specify 4 quotes
    (primary open/close; secondary open/close).)rX   r5   rI   appendr   encoder>   len)
r*   r   r+   r,   r-   	lc_quotesitemlangquotesmultichar_quotess
             r   validate_smartquotes_localesrw      sw    *'5-*7I IE I ) )
	I::c1--LD&& 	 	 	 T"""H 	I 	I 	I A#{{74FGGH I I I	I
 !<<,,  A%%%FF[[A B#{{74FGGH I I I 	$((((s   6B0Bc                     t                      |D ]I}|| v rC| |         }t          |t                    rfd|D             }n|rt          |          }|| |<   JdS )z
    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`.
    Nc                 0    g | ]}t          |          S  )make_one_path_absolute)rT   path	base_paths     r   rV   z'make_paths_absolute.<locals>.<listcomp>  s3     , , ,! 0	4@@ , , ,r   )r   r;   rL   r{   )pathdictkeysr}   r   r   s     `  r   make_paths_absoluter      s     HH	 " "(??SME%&& A, , , ,%*, , , A.y%@@!HSM" "r   c                 |    t           j                            t           j                            | |                    S r^   )osr|   abspathjoin)r}   r|   s     r   r{   r{     s&    7??27<<	488999r   c                    t          |           }t          dt          |          d          D ]}g }||         D ]f}d |d         D             d         }||v r||                                v r|                    ||                    Q|                    |           gt          |          ||<   t          |          S )a  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.)
       r   c                 t    g | ]5}|                     d           |dd                             dd          6S )z--r   N-_)
startswithreplace)rT   
opt_strings     r   rV   z(filter_settings_spec.<locals>.<listcomp>$  sS       &)44T::
122..sC88   r   rk   r   )rL   rangerq   r   ro   tuple)settings_specexcluder   settingsrU   newoptsopt_specopt_names           r   filter_settings_specr     s     M""H1c(mmQ'' % %  	) 	)H *21+   H 7""7<<>>))wx01111x((((Gnn??r   c                   *    e Zd ZdZd Zd Zd Zd ZdS )Valuesz
    Updates list attributes by extension rather than by replacement.
    Works in conjunction with the `OptionParser.lists` instance attribute.
    c                     t          j        j        | g|R i | t          | d          r| j        %t
          j                                        | _        d S d S )Nrecord_dependencies)optparser   __init__hasattrr   r_   r`   ra   selfr   r   s      r   r   zValues.__init__9  sf     7777777344 	G'/'/~'D'D'F'FD$$$ 0/r   c                 0   t          |t                    r|j        }|                                }|j                                        D ]6}t          | |          r$||v r t          | |          }|r|||         z  }||= 7|                     |           d S r^   )	r;   r   __dict__copylistsr   r   getattr_update_loose)r   
other_dictr+   r*   r   s        r   r!   zValues.update@  s    j&)) 	-#,J__&&
$*//11 	, 	,Gg&& ,7j+@+@g.. ,Z00E"7+:&&&&&r   c                 8    |                      | j                  S )z Return a shallow copy of `self`.)defaults)	__class__r   )r   s    r   r   zValues.copyL  s    ~~t}~555r   c                 f    t          | |d          t          | ||           t          | |          S )zUV.setdefault(n[,d]) -> getattr(V,n,d), also set D.n=d if n not in D or None.
        N)r   r   )r   namedefaults      r   
setdefaultzValues.setdefaultP  s8     4t$$,D$(((tT"""r   N)__name__
__module____qualname____doc__r   r!   r   r   rz   r   r   r   r   2  s]         
G G G
' 
' 
'6 6 6# # # # #r   r   c                   6    e Zd Zej        j        ddgz   Zd ZdS )Option	validator	overridesc           	         t           j                            | ||||          }| j        }|r| j        rst          ||          }	 |                     |||          }n9# t          $ r,}t          j        d|dt          |                    d}~ww xY wt          |||           | j
        rt          || j
        d           |S )z
        Call the validator function on applicable settings and
        evaluate the 'overrides' option.
        Extends `optparse.Option.process`.
        zError in option "z":
    N)r   r   processdestr   r   	ExceptionOptionValueErrorr   r   r   )	r   r   r   r   r   resultr*   	new_valuer    s	            r   r   zOption.process\  s     ((sE66JJ) 	6~ 4005 $wv F FII  5 5 5"3333E 2 2 245 5 55 333~ 6555s   A 
B''BBN)r   r   r   r   r   ATTRSr   rz   r   r   r   r   X  s7        O![+$>>E    r   r   c                   p   e Zd ZdZg dZ	 d                                Z	 dddddd	Z	 d
d
d
d
dddddd	Z	  e	e
j        dd          pepdZdZddg ddgi fdddgdedfddgdddfddd gd!d"d#d$fd%d&d'gd!d(d#d$fd)d*gd!dd#d$fd+d,d-gdedfd.d/gd0d1ifd2d3gd4ed5d6fd7d8gd9d!d:d:d;fd<d=gd9d!d>d?fd@dAgd9ddBfdCdDgddedEfdFdGgdHddBfdIdJgddKdedLfdMdNgddKdfdOdPgdedfdQdRgddSdfdTdUgdVdWdXedYfdZd[gdVd\dXedYfd]d^d_gedd`daedbfdcdddegd!dd`d$fdfdgdhgd!dd`d$fdidjgedkddaedlfdmdngd!ddkd$fdodpgedqddaedlfdrdsgdedfdtdugddvdfdwdxgdydzd{fd|d}gddedEfd~dgdddBfdddgdedfddgdedfdddgddedfddgdedfdededddgdeedfdez  dgeedfdddgddddfddgdzeddfddgdzdd4edfdddgddifdddgddifedgddifedgddifedgddifedgddifedgddifedgddifedgdVdedfedgddifR fZ	 dddddZ	 dZdZdej        ej        r
dej        z  pdde
j                                         d         de
j!        dĝZ"	 ddƄZ#dǄ Z$dȄ Z%dɄ Z&dʄ Z'd˄ Z(d̄ Z)d̈́ Z*d΄ Z+dτ Z,dS )OptionParsera  
    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.
    )z/etc/docutils.confz./docutils.confz~/.docutilsz(info 1 warning 2 error 3 severe 4 none 5rk   r   r   rn      )infowarningr    severenoneTF)	1onyestrue0offnofalse r7   Nrl   rm   zGeneral Docutils Optionsz'Specify the document title as metadata.z--titlez2Include a "Generated by Docutils" credit and link.z--generatorz-g
store_true)actionr   z"Do not include a generator credit.z--no-generatorstore_false	generator)r   r   z2Include the date at the end of the document (UTC).z--datez-dstore_constz%Y-%m-%d	datestamp)r   constr   zInclude the time & date (UTC).z--timez-tz%Y-%m-%d %H:%M UTCz'Do not include a datestamp of any kind.z--no-datestampz&Include a "View document source" link.z--source-linkz-sz3Use <URL> for a source link; implies --source-link.z--source-urlmetavarz<URL>z-Do not include a "View document source" link.z--no-source-linkcallback)source_link
source_url)r   r   callback_argsz4Link from section headers to TOC entries.  (default)z--toc-entry-backlinkstoc_backlinksentry)r   r   r   r   z0Link from section headers to the top of the TOC.z--toc-top-backlinkstop)r   r   r   z+Disable backlinks to the table of contents.z--no-toc-backlinks)r   r   z6Link from footnotes/citations to references. (default)z--footnote-backlinks)r   r   r   z/Disable backlinks from footnotes and citations.z--no-footnote-backlinksfootnote_backlinksz0Enable section numbering by Docutils.  (default)z--section-numberingsectnum_xform)r   r   r   r   z&Disable section numbering by Docutils.z--no-section-numberingz/Remove comment elements from the document tree.z--strip-commentsz6Leave comment elements in the document tree. (default)z--leave-commentsstrip_commentszRemove all elements with classes="<class>" from the document tree. Warning: potentially dangerous; use with caution. (Multiple-use option.)z--strip-elements-with-classro   strip_elements_with_classesz<class>)r   r   r   r   zRemove all classes="<class>" attributes from elements in the document tree. Warning: potentially dangerous; use with caution. (Multiple-use option.)z--strip-classstrip_classeszReport system messages at or higher than <level>: "info" or "1", "warning"/"2" (default), "error"/"3", "severe"/"4", "none"/"5"z--reportz-rreport_levelz<level>)choicesr   r   r   r   z4Report all system messages.  (Same as "--report=1".)z	--verbosez-vz3Report no system messages.  (Same as "--report=5".)z--quietz-qzdHalt execution at system messages at or above <level>.  Levels as in --report.  Default: 4 (severe).z--halt
halt_level)r   r   r   r   r   z6Halt at the slightest problem.  Same as "--halt=info".z--strictzjEnable a non-zero exit status for non-halting system messages at or above <level>.  Default: 5 (disabled).z--exit-statusexit_status_levelz3Enable debug-level system messages and diagnostics.z--debugz Disable debug output.  (default)z
--no-debugdebugz-Send the output of system messages to <file>.z
--warningswarning_streamz<file>)r   r   z1Enable Python tracebacks when Docutils is halted.z--tracebackz%Disable Python tracebacks.  (default)z--no-traceback	tracebackziSpecify the encoding and optionally the error handler of input text.  Default: <locale-dependent>:strict.z--input-encodingz-iz<name[:handler]>)r   r   zlSpecify the error handler for undecodable characters.  Choices: "strict" (default), "ignore", and "replace".z--input-encoding-error-handlerstrict)r   r   z^Specify the text encoding and optionally the error handler for output.  Default: UTF-8:strict.z--output-encodingz-outf-8)r   r   r   zSpecify error handler for unencodable output characters; "strict" (default), "ignore", "replace", "xmlcharrefreplace", "backslashreplace".z--output-encoding-error-handlerzDSpecify text encoding and error handler for error output.  Default: r3   .z--error-encodingz-ezSSpecify the error handler for unencodable characters in error output.  Default: %s.z--error-encoding-error-handlerz<Specify the language (as BCP 47 language tag).  Default: en.z
--languagez-llanguage_codeenz<name>)r   r   r   z)Write output file dependencies to <file>.z--record-dependencies)r   r   r   z6Read configuration settings from <file>, if it exists.z--configstring)r   typer   r   z,Show this program's version number and exit.z	--versionz-Vr   versionz Show this help message and exit.z--helpz-hhelpz--id-prefixr   r   z--auto-id-prefix%z--dump-settingsz--dump-internalsz--dump-transformsz--dump-pseudo-xmlz--expose-internal-attributeexpose_internals)r   r   r   z--strict-visitor)_disable_config_source_destination_config_files)r   generalz%prog (Docutils z [%s]z	, Python r   z, on )rz   c                 t   i | _         	 g | _        	 t          j        j        | g|R t
          dt          j        d          d| | j        s| j        | _        t          | j
                  | _
        | ft          |          z   | _        |                     | j                   |                     |pi            |rx| j        d         sm	 |                                 }n9# t"          $ r,}|                     t'          |                     Y d}~nd}~ww xY w|                     |j                   dS dS dS )z
        `components` is a list of Docutils components each containing a
        ``.settings_spec`` attribute.  `defaults` is a mapping of setting
        default overrides.
        NN   )width)option_classadd_help_option	formatterr   )r   config_filesr   r   r   r   TitledHelpFormatterr   version_templaterL   relative_path_settingsr   
componentspopulate_from_componentsset_defaults_from_dictr   get_standard_config_settingsr   r    r   r   )r   r  r   read_config_filesr   r   config_settingsr    s           r   r   zOptionParser.__init__O  s    
(;&	 	 	%t2<<<	 	 	 	 	 | 	10DL&*4+F&G&G#'E*$5$55%%do666##HN333 	BT]3D%E 	B."&"C"C"E"E . . .

:e,,--------.''(@AAAAA	B 	B 	B 	Bs   C! !
D+"DDc                 L   |D ]}||j         }| j                            |j                   t          dt	          |          d          D ]}|||dz            \  }}}|r,t          j        | ||          }|                     |           n| }|D ]=\  }	}
} |j        |
d|	i|}|	                    d          dk    rd| j
        |j        <   >|j        r| j                            |j                   |D ]*}|r&|j        r| j                            |j                   +dS )aE  
        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.
        Nr   r   r   r   ro   T)r   r  rN   r   rq   r   OptionGroupadd_option_group
add_optiongetr   r   settings_defaultsr   r!   settings_default_overrides)r   r  	componentr   rU   titledescriptionoption_specgroup	help_textoption_stringsr   r   s                r   r  z%OptionParser.populate_from_componentso  s    $ 	F 	FI %3M'..02 2 21c-00!44 F F2?!A#2F/{K !$0ukJJE))%0000 E;F 7 77Y-U-~ 89 8068 8Fzz(++x7726
6;/. FM(()DEEEF $ 	K 	KI KYA K$$Y%IJJJ	K 	Kr   c                     	 t           j        d                             t           j                  }n# t          $ r
 | j        }Y nw xY wt           j        j        dt           j        vr	 ddl}n# t          $ r d Y nw xY wfd|D             S )z:Return list of config files, from environment or standard.DOCUTILSCONFIGHOMEr   Nc                     | S r^   rz   )xs    r   <lambda>z8OptionParser.get_standard_config_files.<locals>.<lambda>  s    1 r   c                 N    g | ]!}|                                  |          "S rz   rS   )rT   fexpands     r   rV   z:OptionParser.get_standard_config_files.<locals>.<listcomp>  s.    ===a17799=q		===r   )
r   environr5   pathsepr@   standard_config_filesr|   
expanduserpwdImportError)r   r   r$  r  s      @r   get_standard_config_filesz&OptionParser.get_standard_config_files  s    	6:&67==bjIILL 	6 	6 	65LLL	6 ###%



 % % %$%====<====s!   /3 AA*A/ /A?>A?c                     t                      }|                                 D ]+}|                    |                     |          |            ,|S r^   )r   r&  r!   r   )r   r   filenames      r   r  z)OptionParser.get_standard_config_settings  sR    886688 	K 	KHOOD99(CCTJJJJr   c                 &   t                      }|                    ||            | j                            |j                   t
          j                            |          }t                      }t                      }| j
        D ]j}|st          |j        pd          |j        fz   D ]E}||v r|                    |           |                    |                    |          |            Fkt#          |j        | j        |           |j        S )zAReturns a dictionary containing appropriate config file settings.rz   )ConfigParserreadr   rN   _filesr   r|   dirnamer6   r   r  r   config_section_dependenciesr-   addr!   get_sectionr   r   r  )r   config_filer   r}   appliedr   r  sections           r   r   z%OptionParser.get_config_file_settings  s"   K&&&  ///GOOK00	%%88 	C 	CI !)"G"M2NN(79: C Cg%%G$$$ 2 27 ; ;TBBBBC 	t:I	G 	G 	G  r   c                     |                      |          \  |_        |_        t          |j        | j                   | j        |_        |S )z/Store positional arguments as runtime settings.)
check_argsr   r   r   r   r  r   r   )r   r   r   s      r   check_valueszOptionParser.check_values  sB    .2ood.C.C++FOT-HIII#0r   c                     d x}}|r|                     d          }|dk    rd }|r|                     d          }|dk    rd }|r|                     d           |r||k    r|                     d           ||fS )Nr   r   zMaximum 2 arguments allowed.z_Do not specify the same file for both source and destination.  It will clobber the source file.)rM   r    )r   r   sourcedestinations       r   r5  zOptionParser.check_args  s    ## 	XXa[[F}} 	#((1++Kc!!" 	7JJ5666 	If++JJ H I I I{""r   c                 :    | j                             |           d S r^   )r   r!   r   r   s     r   r  z#OptionParser.set_defaults_from_dict  s    X&&&&&r   c                 F    t          | j                  }| j        |_        |S )z(Needed to get custom `Values` instances.)r   r   r   r   r;  s     r   get_default_valueszOptionParser.get_default_values  s!    $-((!%!2r   c                 x    | j         | gz   D ]}|j        D ]}|j        |k    r|c c S t          d|z            )a  
        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.
        zNo option with dest == %r.)option_groupsoption_listr   r@   )r   r   r  r   s       r   get_option_by_destzOptionParser.get_option_by_dest  si     '4&0 	" 	"E+ " ";$&&!MMMMM '" 3d:;;;r   )rz   NN)-r   r   r   r   r"  r5   threshold_choicesrH   r=   r   sysstderrr
   default_error_encoding$default_error_encoding_error_handlerrA   r   ri   rJ   r9   r1   rc   r#   r   rP   r   r  r  r-   r_   __version____version_details__r   platformr  r   r  r&  r  r   r6  r5  r  r=  rA  rz   r   r   r   r   s  s	          I CHHJJGAANNJ@tD$eeP PH?$WSZ%)+ + I.=IAH  ,>( 	#a	
3+r
 a	
>$
L/?"A "A
Ba	
 /
LL
Na	 ?T
}z%02 2
3a	 +T
}&:%02 2
3a	 4
'24 4
5a	" 3D
!l1A$C $C
D#a	( @
Y0
2)a	, :
^9; ;
<-a	4 A"
#"mg 
 5a	< = 
!"me
L
L
N=a	B 8
 "m
<
<
>Ca	H C!
"!a(* *
+Ia	P <$
%'=
A
A
CQa	V = 
!!?&68 8
9Wa	^ 3#
$"O
<
<
>_a	d <
!0@
A
A
Cea	j C
",<
=
=
?ka	p# )
)'D.BD D	
Eqa	|# 
.BD D	
E}a	HKt
*;'5),>@ @
AIa	R A
-!(6 8  8
9Sa	X @d
&46 6
7Ya	^9*"3\"#	$68 8
9_a	h C,=1!-/ /
0ia	n6
):&9)*y+=? ?
@oa	z @+,=MNN
P{a	~ -.]GDD
Fa	B :.#3II
KCa	F >/lt)9; ;
<Ga	L 2
{mLL
NMa	PNt
$(;= =
>Qa	ZB+
,-L
M
M
O[a	b,
%(W;= =
>ca	l5 -
--L
M
M	
Oma	 a	z $##%I%I%IK t
$(5K;= =	
>wa	B(01 ,
,:79 9	
:Ca	N I
T,4!6 !6
7Oa	T 6"
#-E 
Ua	\ C,Hh#-;KM M
N]a	b 9
)4
6ca	f -T
Xv.
0ga	l -9b/	:ma	n ,-	3/?	@oa	r +,x.F	Gsa	t ,-,/G	Hua	v -.<0H	Iwa	x -.<0H	Iya	z 78'9<> >
?{a	@ ,-,/G	HAa	 a	dMJ0 -1$()-*.0 0 Q0NN $//#7 @"8#??FCEF F;,,..q1113<<<	A
 #B B B B@K K K>> > >(  ! ! !*  # # #"' ' '  < < < < <r   r   c                   H    e Zd ZddddZ	 dZdZd Zd Zd	 Zd
 Z	d Z
d ZdS )r*  )pep_html writer
stylesheet)rK  stylesheet_path)rK  template)pep_stylesheetpep_stylesheet_pathpep_templatea	  
The "[option]" section is deprecated.  Support for old-format configuration
files will be removed in a future Docutils release.  Please revise your
configuration files.  See <http://docutils.sf.net/docs/user/config.html>,
section "Old-Format Configuration Files".
zhUnable to read configuration file "%s": content not encoded as UTF-8.
Skipping "%s" configuration file.
c                 f    t          j        | g|R i | g | _        	 t                      | _        d S r^   )r   r   r,  r   _stderrr   s      r   r   zConfigParser.__init__  s>     77777778"}}DDr   c                    t          |          t          t          fv r|g}|D ] }	 t          j        |dd          }n# t
          $ r Y 'w xY w	 t          j        dk     rt          j	        | ||           nt          j
        | ||           nH# t          $ r; | j                            | j        ||fz             |                                 Y w xY w|                                 | j                            |           |                     d          r|                     |           |                     ||           "d S )Nrr   r   options)r   strunicoder&   openrb   rC  version_infor   readfp	read_fileUnicodeDecodeErrorrS  writenot_utf8_errorcloser,  ro   has_sectionhandle_old_configvalidate_settings)r   	filenamesr+   r(  fps        r   r+  zConfigParser.read  sj   	??sGn,,"I! 	< 	<H[388   #f,,#*4X>>>>#-dBAAA%   ""4#6(H9M#MNNN


 HHJJJKx(((	** 1&&x000""8];;;;'	< 	<s"   >
A
A=BACCc                    t          j        | j        t          |d           |                     d          }|                     d          s|                     d           |                                D ]z\  }}|| j        v r;| j        |         \  }}|                     |          s|                     |           nd}|}| 	                    ||          s| 
                    |||           {|                     d           d S )Nr   rV  r   )warningswarn_explicitold_warningConfigDeprecationWarningr0  ra  add_sectionr   old_settings
has_optionr6   remove_section)r   r(  rV  r   r   r3  r*   s          r   rb  zConfigParser.handle_old_config%  s   t/1I'	, 	, 	,""9--	** 	(Y'''!--// 		2 		2JCd'''#'#4S#9 ''00 .$$W---#??7G44 2'5111I&&&&&r   c                    |                                  D ]}|                     |          D ]}	 |                    |          }n# t          $ r Y %w xY w|j        r|                     ||          }	 |                    |||| |          }n=# t          $ r0}t          d|d|dt          |          d|d|
          d}~ww xY w| 	                    |||           |j
        r| 	                    ||j
        d           ڌdS )zi
        Call the validator function and implement overrides on all applicable
        settings.
        )r,   r-   zError in config file "z", section "[z]":
    z	
        z = N)sectionsrV  rA  r@   r   r  r   r   r   r6   r   )	r   r(  r+   r3  r*   r   r   r   r    s	            r   rc  zConfigParser.validate_settings7  sm   
 }} 	> 	>G<<00 > >*==gFFFF   H# : HHWg66E
0$*$4$4#UM*.w %5 %H %H		 % 0 0 0(j  (xx+e2D2D2D2D&ww	/0 0 00 HHWgy999# >HHWf&6===)>	> 	>s)   A
AA3B
C+CCc                 R    |                                                     dd          S )zW
        Transform '-' to '_' so the cmdline form of option names can be used.
        r   r   )r?   r   )r   	optionstrs     r   optionxformzConfigParser.optionxformS  s$       ((c222r   c                     i }|                      |          r1|                     |          D ]}|                     ||          ||<   |S )zf
        Return a given section as a dictionary (empty if the section
        doesn't exist).
        )ra  rV  r  )r   r3  section_dictr   s       r   r0  zConfigParser.get_sectionY  s^    
 G$$ 	A,,w// A A'+xx'@'@V$$r   N)r   r   r   rl  ri  r_  r   r+  rb  rc  rs  r0  rz   r   r   r*  r*    s         <E79 9LPKN
E E E< < <0' ' '$> > >83 3 3	 	 	 	 	r   r*  c                       e Zd ZdZdS )rj  z3Warning for deprecated configuration file features.N)r   r   r   r   rz   r   r   rj  rj  e  s        ====r   rj  )NNr^   )1r   __docformat__r   os.pathrC  rg  r&   r   r   rZ  configparserr   r   r*  r	   r_   docutils.utilsdocutils.nodesdocutils.utils.error_reportingr
   r   r   r   rW  rX  r   r#   r.   r1   r9   rA   rC   rF   rJ   rP   rX   r\   rc   ri   rw   r   r{   r   r   r   r   SettingsSpecFutureWarningrj  rz   r   r   <module>r     s  
 2 # 				  



    " " " " " "v,,,,,,,,,,,,$$$$$$         F F F F F F F F F F F F vG
+ 
+ 
+/ / / :>    HL
 
 
 
 GK   . 9=A A A A 9=    AE    ;?@ @ @ @ GK    HL     GK    AE3 3 3 3 =A    =A! ! ! !F" " " "(: : :  <## ## ## ## ##X_ ## ## ##L    X_   6y< y< y< y< y<8((*? y< y< y<xs s s s s? s s sl> > > > >} > > > > >r   