
    ziB                        d Z dZddlZddlZddlZddlm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m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j#                  Z$ G d  d!e%          Z&d" Z'dS )%a  
Command-line and common processing for Docutils front-end tools.

This module is provisional.
Major changes will happen with the switch from the deprecated
"optparse" module to "arparse".

Applications should use the high-level API provided by `docutils.core`.
See https://docutils.sourceforge.io/docs/api/runtime-settings.html.

Exports the following classes:

* `OptionParser`: Standard Docutils command-line processing.
  Deprecated. Will be replaced by an ArgumentParser.
* `Option`: Customized version of `optparse.Option`; validation support.
  Deprecated. Will be removed.
* `Values`: Runtime settings; objects are simple structs
  (``object.attribute``).  Supports cumulative list settings (attributes).
  Deprecated. Will be removed.
* `ConfigParser`: Standard Docutils config file processing.
  Provisional. Details will change.

Also exports the following functions:

Interface function:
   `get_default_settings()`.  New in 0.19.

Option callbacks:
   `store_multiple()`, `read_config_file()`. Deprecated.

Setting validators:
  `validate_encoding()`, `validate_encoding_error_handler()`,
  `validate_encoding_and_error_handler()`,
  `validate_boolean()`, `validate_ternary()`,
  `validate_nonnegative_int()`, `validate_threshold()`,
  `validate_colon_separated_string_list()`,
  `validate_comma_separated_list()`,
  `validate_url_trailing_slash()`,
  `validate_dependency_file()`,
  `validate_strip_class()`
  `validate_smartquotes_locales()`.

  Provisional.

Misc:
  `make_paths_absolute()`, `filter_settings_spec()`. Provisional.
reStructuredText    N)SUPPRESS_HELP)ioutilsc                     |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           \/var/www/tmov.alphamb/tmov_inventario/venv/lib/python3.11/site-packages/docutils/frontend.pystore_multipler   E   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_settingserrs         r   read_config_filer   R   sz    66u==   S
Mv.....s    
A<Ac                     |dk    rd S 	 t          j        |           n$# t          $ r t          d| d|d          w xY w|S )N z	setting "z": unknown encoding: "")codecslookupLookupErrorsettingr   option_parserconfig_parserconfig_sections        r   validate_encodingr)   ]   sp    {{t.e . . .k$WWeee- . . 	.. Ls	    !A 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_handlerr,   i   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)splitr,   setr   r	   r)   )r%   r   r&   r'   r(   encodinghandlers          r   #validate_encoding_and_error_handlerr4   v   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_booleanr<      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.
    )r6   r7   r8   r9   r:   r;   r$   s        r   validate_ternaryr>      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_intrA      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.)r@   r   
thresholdsr:   r;   AttributeErrorr#   r$   s        r   validate_thresholdrE      s    @5zz @ @ @	@ +EKKMM::::.) 	@ 	@ 	@6>???	@@s    
A%=A%$A!!A%c                     t          |t                    s|                    d          }n<|                                }|                    |                    d                     |S )Nr.   )r6   listr0   popextend)r%   r   r&   r'   r(   lasts         r   $validate_colon_separated_string_listrK      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 	
)r9   ).0is     r   
<listcomp>z1validate_comma_separated_list.<locals>.<listcomp>   s5    KKK!!''':J:JKQWWWKKKr   ,)r6   rG   rH   r0   rI   )r%   r   r&   r'   r(   rJ   r
   s          r   validate_comma_separated_listrR      s`     eT""  99;;DKKtzz#KKKE	LLLr   c                 B    |sdS |                     d          r|S |dz   S )Nz.//)endswithr$   s        r   validate_url_trailing_slashrV      s2     t			 s{r   c                 t    	 t          j        |          S # t          $ r t          j        d           cY S w xY wN)r   DependencyListOSErrorr$   s        r   validate_dependency_filer[      sJ    *#E*** * * *#D)))))*s    77c                     t          | ||||          }|D ]=}t          j                            |          }||k    rt	          d|d|d          >|S )NzInvalid class value z
 (perhaps z?))rR   docutilsnodesmake_idr   )r%   r   r&   r'   r(   cls
normalizeds          r   validate_strip_classrb      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.r.      z4Invalid value "%s". Format is "<language>:<quotes>".asciibackslashreplace   z[Invalid value "%s". Please specify 4 quotes
    (primary open/close; secondary open/close).)rR   r0   rD   appendr   encoder9   len)
r%   r   r&   r'   r(   	lc_quotesitemlangquotesmultichar_quotess
             r   validate_smartquotes_localesrp      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 O#{{74FGGH I I I 	$((((s   6B0Bc                     t          j                    |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)rN   path	base_paths     r   rP   z'make_paths_absolute.<locals>.<listcomp>)  s3     , , ,! 0	4@@ , , ,r   )osgetcwdr6   rG   rt   )pathdictkeysrv   r   r   s     `  r   make_paths_absoluter{     s     IKK	 " "(??SME%&& A, , , ,%*, , , A.y%@@!HSM" "r   c                 |    t           j                            t           j                            | |                    S rX   )rw   ru   abspathjoin)rv   ru   s     r   rt   rt   0  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 )aj  Return a copy of `settings_spec` excluding/replacing some settings.

    `settings_spec` is a tuple of configuration settings
    (cf. `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.)
          c                 t    g | ]5}|                     d           |dd                             dd          6S )z--r   N-_)
startswithreplace)rN   
opt_strings     r   rP   z(filter_settings_spec.<locals>.<listcomp>D  sS     8 8 8&%00668
122..sC88 8 8 8r   rd   r   )rG   rangerj   rz   rh   tuple)settings_specexcluder   settingsrO   newoptsopt_specopt_names           r   filter_settings_specr   4  s     M""H1c(mmQ'' % %  
	) 
	)H8 8*21+8 8 889;H 7""7<<>>))wx01111x((((Gnn??r   c                   4     e Zd ZdZ fdZd Zd Zd Z xZS )ValueszStorage for option values.

    Updates list attributes by extension rather than by replacement.
    Works in conjunction with the `OptionParser.lists` instance attribute.

    Deprecated. Will be removed.
    c                     t          j        dt          d            t                      j        |i | t          | dd           t          j                    | _        d S d S )Nz@frontend.Values class will be removed in Docutils 0.21 or later.r   
stacklevelrecord_dependencies)	warningswarnDeprecationWarningsuper__init__getattrr   rY   r   selfr   r   	__class__s      r   r   zValues.__init__Z  sv     3(Q	8 	8 	8 	8 	$)&)))4.55=',';'='=D$$$ >=r   c                 &   t          |t                    r|j        }t          |          }|j                                        D ]6}t          | |          r$||v r t          | |          }|r|||         z  }||= 7|                     |           d S rX   )	r6   r   __dict__dictlistsrz   hasattrr   _update_loose)r   
other_dictr&   r%   r   s        r   r   zValues.updatec  s    j&)) 	-#,J*%%
$*//11 	, 	,GtW%% ,'Z*?*?g.. ,Z00E"7+:&&&&&r   c                     t          j                    5  t          j        dt                     |                     | j                  cddd           S # 1 swxY w Y   dS )z Return a shallow copy of `self`.ignorecategory)defaultsN)r   catch_warningsfilterwarningsr   r   r   )r   s    r   copyzValues.copyo  s    $&& 	: 	:#H7IJJJJ>>4=>99	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	:s   6AAAc                 f    t          | |d          t          | ||           t          | |          S )znReturn ``self.name`` or ``default``.

        If ``self.name`` is unset, set ``self.name = default``.
        N)r   r   )r   namedefaults      r   
setdefaultzValues.setdefaultu  s8    
 4t$$,D$(((tT"""r   )	__name__
__module____qualname____doc__r   r   r   r   __classcell__r   s   @r   r   r   Q  so         > > > > >
' 
' 
': : :# # # # # # #r   r   c                   N     e Zd ZdZej        j        ddgz   Z fdZ fdZ xZ	S )Optionz`Add validation and override support to `optparse.Option`.

    Deprecated. Will be removed.
    	validator	overridesc                 r    t          j        dt          d            t                      j        |i | d S )NzDThe frontend.Option class will be removed in Docutils 0.21 or later.r   r   )r   r   r   r   r   r   s      r   r   zOption.__init__  sJ     3(Q	8 	8 	8 	8 	$)&)))))r   c           	         t                                          ||||          }| j        }|r| j        rxt	          ||          }	 |                     |||          }n># t
          $ r1}t          j        d|dt          j	        |                    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   processdestr   r   	ExceptionoptparseOptionValueErrorr   error_stringr   r   )
r   r   r   r	   r   resultr%   	new_valuer   r   s
            r   r   zOption.process  s     eVV<<) 	6~ 4007 $wv F FII  7 7 7"3333 4 4 467 7 77 333~ 6555s   A 
B),BB)
r   r   r   r   r   r   ATTRSr   r   r   r   s   @r   r   r     sq         
 O![+$>>E* * * * *        r   r   c                       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j        pdZdZddg ddgddifddgdd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d0d1d2gdedfd3d4gdd5ifd6d7gd8ed9d:fd;d<gd=d&d>d>d?fd@dAgd=d&dBdCfdDdEgd=d dFfdGdHgddedIfdJdKgdLd dFfdMdNgddOdedPfdQdRgd dOd"fdSdTgdedfdUdVgd dWd"fdXdYgdZd[d\ed]fd^d_gdZd`d\ed]fdadbdcgeddddeedffdgdhdigd&dddd)fdjdkdlgd&dddd)fdmdngedoddeedpfdqdrgd&ddod)fdsdtgeduddeedpfdvdwgdedfdxdygd dzd"fd{d|gd}d~dfddgddedIfddgdd dF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d~eddfddgd~dd8e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dZdedfedgddifR fZ	 dddddZ	 dZdej        ej        r
dej        z  pdde
j                                         d         de
j!        dǝZ"	 dӈ fdɄ	Z#dʄ Z$e%d˄             Z&d̄ Z'd̈́ Z(d΄ Z)dτ Z*dЄ Z+dф Z,d҄ Z- xZ.S )OptionParsera  
    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`.
    )z/etc/docutils.confz./docutils.confz~/.docutilsz(info 1 warning 2 error 3 severe 4 none 5rd   r   r   rg      )infowarningr   severenoneTF)	1onyestrue0offnofalser   r2   Nre   rf   zGeneral Docutils OptionszaOutput destination name. Obsoletes the <destination> positional argument. Default: None (stdout).z--outputmetavarz<destination>z'Specify the document title as metadata.z--titlez<title>z2Include 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-urlz<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-classrh   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	tracebackzdSpecify the encoding and optionally the error handler of input text.  Default: <auto-detect>: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-handlerzOSpecify text encoding and optionally error handler for error output.  Default: r.   .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generalz%prog (Docutils z [%s]z	, Python r   z, on )rs   c                 j   i | _         	 g | _        	 dg| _        t          j        dt
          d            t                      j        |t          dt          j
        d          d| | j        s| j        | _        | g|R | _        |                     | j                   | j                            |pi            |rp| j        d	         se	 |                                 }n,# t$          $ r}|                     |           Y d}~nd}~ww xY w| j                            |j                   dS dS dS )
zSet up OptionParser instance.

        `components` is a list of Docutils components each containing a
        ``.settings_spec`` attribute.
        `defaults` is a mapping of setting default overrides.
        r   ztThe frontend.OptionParser class will be replaced by a subclass of argparse.ArgumentParser in Docutils 0.21 or later.r   r   NN   )width)option_classadd_help_option	formatterr   )r   config_filesrelative_path_settingsr   r   r   r   r   r   r   TitledHelpFormatterr   version_template
componentspopulate_from_componentsr   r   get_standard_config_settingsr   r   r   )	r   r  r   read_config_filesr   r   config_settingsr   r   s	           r   r   zOptionParser.__init__  s    
(;'7&8# 3 )Q	8 	8 	8 	8 	 '-d#+#?b#I#I#I	* 	*"(	* 	* 	* | 	10DL-*--%%do666X^,,, 	;T]3D%E 	; "&"C"C"E"E      

3 M  !9:::::	; 	; 	; 	;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 )ao  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.
        Nr   r   r   r   rh   T)r   r
  rI   r   rj   r   OptionGroupadd_option_group
add_optiongetr   r   settings_defaultsr   r   settings_default_overrides)r   r  	componentr   rO   titledescriptionoption_specgroup	help_textoption_stringsr   r   s                r   r  z%OptionParser.populate_from_components  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                     dt           j        v r0t           j        d                             t           j                  }n| j        }d |D             S )z:Return list of config files, from environment or standard.DOCUTILSCONFIGc                 t    g | ]5}|                                 t          j                            |          6S rs   )r9   rw   ru   
expanduser)rN   fs     r   rP   z:OptionParser.get_standard_config_files.<locals>.<listcomp>  s5    III!qwwyyI""1%%IIIr   )rw   environr0   pathsepstandard_config_files)r`   r	  s     r   get_standard_config_filesz&OptionParser.get_standard_config_files  sL     rz)):&67==bjIILL4LII|IIIIr   c                 .   t          j                    5  t          j        dt                     t	                      }d d d            n# 1 swxY w Y   |                                 D ]+}|                    |                     |          |            ,|S )Nr   r   )r   r   r   r   r   r(  r   r   )r   r   filenames      r   r  z)OptionParser.get_standard_config_settings  s    $&& 	  	 #H7IJJJJxxH	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  6688 	K 	KHOOD99(CCTJJJJs   *A

AAc                    t                      }t                      }t          j                    5  t          j        dt
                     | xj        |                    ||           z  c_        t                      }ddd           n# 1 swxY w Y   | j	        D ]r}|st          |j        pd          |j        fz   D ]M}||v r|                    |           |                    |          r|                    ||         |            Nst!          |j        | j        t&          j                            |                     |j        S )zAReturns a dictionary containing appropriate config file settings.r   r   Nrs   )ConfigParserr1   r   r   r   r   r	  readr   r  r   config_section_dependenciesr(   addhas_sectionr   r{   r   r
  rw   ru   dirname)r   config_filer'   appliedr   r  sections          r   r   z%OptionParser.get_config_file_settings  s   $%%$&& 	  	 #H7IJJJJ!3!3K!F!FFxxH	  	  	  	  	  	  	  	  	  	  	  	  	  	  	   		B 		BI !)"G"M2NN(79: B Bg%%G$$$ ,,W55 BOOM'$:DAAAB 	H- 7GOOK88	: 	: 	:   s   AB

BB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.)rH   r   )r   r   sourcedestinations       r   r6  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 rX   )r   r   r   r   s     r   set_defaults_from_dictz#OptionParser.set_defaults_from_dict  s    X&&&&&r   c                     t          j                    5  t          j        dt                     t	          | j                  }ddd           n# 1 swxY w Y   | j        |_        |S )z(Needed to get custom `Values` instances.r   r   N)r   r   r   r   r   r   r	  r   r<  s     r   get_default_valueszOptionParser.get_default_values  s    $&& 	- 	-#H7IJJJJdm,,H	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- "&!2s   0AAA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   )rs   NF)/r   r   r   r   r'  r0   threshold_choicesrC   r8   r   sysstderrr   _locale_encodingdefault_error_encoding$default_error_encoding_error_handlerr<   r   rb   rE   r4   r,   r[   r   r   rK   r   r  r(   r]   __version____version_details__r   platformr  r   r  classmethodr(  r  r   r7  r6  r=  r?  rC  r   r   s   @r   r   r     s	
          
 CHHJJGAANNJ@dDuEEuF FH?%gcj*dCC )!#!4)!(  ,>( 	#e	 9,O4
6 e	 4+	9-
/e	
 ?$
L/?"A "A
Be	 /
LL
Ne	 ?T
}z%02 2
3e	 +T
}&:%02 2
3e	" 4
'24 4
5#e	( 3D
!l1A$C $C
D)e	. @
Y0
2/e	2 :
^9; ;
<3e	: A"
#"mg 
 ;e	B = 
!"me
L
L
NCe	H 8
 "m
<
<
>Ie	N C!
"!a(* *
+Oe	V <$
%'=
A
A
CWe	\ = 
!!?&68 8
9]e	d 3#
$"O
<
<
>ee	j <
!0@
A
A
Cke	p C
",<
=
=
?qe	v# )
)'D.BD D	
Ewe	B# 
.BD D	
ECe	NKt
*;'5),>@ @
AOe	X A
-!(6 8  8
9Ye	^ @d
&46 6
7_e	d9*"3\"#	$68 8
9ee	n C,=1!-/ /
0oe	t6
):&9)*y+=? ?
@ue	@ @+,%57 7
8Ae	F -.]GDD
FGe	J :.#3II
KKe	N >/lt)9; ;
<Oe	T 2
{mLL
NUe	XIt
$(;= =
>Ye	bB+
,-L
M
M
Oce	j,
%(W;= =
>ke	t5 -
--L
M
M	
Oue	 e	B $##%I%I%IK t
$(5K;= =	
>e	J(01 ,
,:79 9	
:Ke	V I
T,4!6 !6
7We	\ 6"
#-E 
]e	d C,Hh#-;KM M
Nee	j 9
)4
6ke	n -T
Xv.
0oe	t -9b/	:ue	v ,-	3/?	@we	z +,x.F	G{e	| ,-,/G	H}e	~ -.<0H	Ie	@ -.<0H	IAe	B 78'9<> >
?Ce	H ,-,/G	HIe	 e	hMR0 -1$()-*.0 0
 NN $//#7 D&x'CCJGIJ J;,,..q1113<<<	A
 #"; "; "; "; "; ";HK K K@ J J [J  ! ! !0  # # #"' ' '  < < < < < < <r   r   c                   R     e Zd ZdZddddZ	 dZdZd fd		Zd
 Zd Z	d Z
d Z xZS )r,  aZ  Parser for Docutils configuration files.

    See https://docutils.sourceforge.io/docs/user/config.html.

    Option key normalization includes conversion of '-' to '_'.

    Config file encoding is "utf-8". Encoding errors are reported
    and the affected file(s) skipped.

    This class is provisional and will change in future versions.
    )pep_html writer
stylesheet)rO  stylesheet_path)rO  template)pep_stylesheetpep_stylesheet_pathpep_templatea  The "[option]" section is deprecated.
Support for old-format configuration files will be removed in Docutils 0.21 or later.  Please revise your configuration files.  See <https://docutils.sourceforge.io/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.
Nc                    |t          j        dt          d           g }t          |t                    r|g}|D ]}	 |t                                          |d          z  }n9# t          $ r, t          j	        
                    | j        ||fz             Y _w xY wd| v r|                     |           ||                     ||           |S )Nzbfrontend.ConfigParser.read(): parameter "option_parser" will be removed in Docutils 0.21 or later.r   r   r   )r2   options)r   r   r   r6   strr   r-  UnicodeDecodeErrorrE  rF  writenot_utf8_errorhandle_old_configvalidate_settings)r   	filenamesr&   read_okr*  r   s        r   r-  zConfigParser.readO  s    $M 7 -< < < < i%% 	$"I! 
	@ 
	@H577<<7<CCC%   
  !4(7K!KLLL D  &&x000(&&x???s   &A&&3BBc                    t          j        | j        t          |d           |                     d          }|                     d          s|                     d           |                                D ]z\  }}|| j        v r;| j        |         \  }}|                     |          s|                     |           nd}|}| 	                    ||          s| 
                    |||           {|                     d           d S )Nr   rW  r  )r   warn_explicitold_warningConfigDeprecationWarningget_sectionr0  add_sectionr
   old_settings
has_optionr1   remove_section)r   r*  rW  r   r   r4  r%   s          r   r\  zConfigParser.handle_old_configg  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|                     ||          }	 |                    |||| |          }nB# t          $ r5}t          d| d| dt          j	        |           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)sectionsrW  rC  r;   r   r  r   r   r   r   r1   r   )	r   r*  r&   r4  r%   r   r   r   r   s	            r   r]  zConfigParser.validate_settingsy  s   
 }} 	> 	>G<<00 > >*==gFFFF   H# : HHWg66EI$*$4$4#UM*.w %5 %H %H		 % I I I( *H( *H *H6=*H *H020D0D*H *H 5<*H *H AF*H *H I I II
 HHWgy999# >HHWf&6===%>	> 	>s)   A
AA3B
C0CCc                 R    |                                                     dd          S )z
        Lowercase and transform '-' to '_'.

        So the cmdline form of option names can be used in config files.
        r   r   )r:   r   )r   	optionstrs     r   optionxformzConfigParser.optionxform  s$       ((c222r   c                     t          j        dt          d           	 t          | |                   S # t          $ r i cY S w xY w)z
        Return a given section as a dictionary.

        Return empty dictionary if the section doesn't exist.

        Deprecated. Use the configparser "Mapping Protocol Access" and
        catch KeyError.
        zNfrontend.OptionParser.get_section() will be removed in Docutils 0.21 or later.r   r   )r   r   r   r   r;   )r   r4  s     r   rd  zConfigParser.get_section  sc     	 C(Q	8 	8 	8 	8	W&&& 	 	 	III	s   3 AArX   )r   r   r   r   rf  rb  r[  r-  r\  r]  rm  rd  r   r   s   @r   r,  r,  .  s        
 
 <E79 9L
	4 N
     0' ' '$> > >43 3 3      r   r,  c                       e Zd ZdZdS )rc  z3Warning for deprecated configuration file features.N)r   r   r   r   rs   r   r   rc  rc    s        ====r   rc  c                      t          j                    5  t          j        dt                     t	          |                                           cddd           S # 1 swxY w Y   dS )a|  Return default runtime settings for `components`.

    Return a `frontend.Values` instance with defaults for generic Docutils
    settings and settings from the `components` (`SettingsSpec` instances).

    This corresponds to steps 1 and 2 in the `runtime settings priority`__.

    __ https://docutils.sourceforge.io/docs/api/runtime-settings.html
       #settings-priority
    r   r   N)r   r   r   r   r   r?  )r  s    r   get_default_settingsrq    s     
	 	"	" = =3EFFFFJ''::<<= = = = = = = = = = = = = = = = = =s   <AA!$A!)NNrX   )(r   __docformat__r!   configparserr   r   rw   os.pathrE  r   r]   r   r   r   r   r)   r,   r4   r<   r>   rA   rE   rK   rR   rV   r[   rb   rp   r{   rt   r   r   r   r   SettingsSpecRawConfigParserr,  FutureWarningrc  rq  rs   r   r   <module>rx     sK  
. .` #       " " " " " " 				  



          
+ 
+ 
+/ / / :>	 	 	 	 HL
 
 
 
 GK   0 9=A A A A 9=     AE    ;?@ @ @ @ GK    FJ   " GK    AE* * * * =A    EI! ! ! !H" " " "(: : :  :+# +# +# +# +#X_ +# +# +#\" " " " "X_ " " "JG< G< G< G< G<8((*? G< G< G<T| | | | |</ | | |~> > > > >} > > >= = = = =r   