
    <i                       d Z ddlm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
Z
ddlmZ ddlmZ ddlZddlmZmZ dZer4dd	lmZmZmZ dd
lmZmZmZmZ ddlmZmZmZ ddlmZ  G d de          Z dYdZ!dZdZ"	 	 	 	 d[d\d$Z#	 	 	 	 d[d]d%Z$	 	 	 	 d[d]d&Z%	 	 	 	 d[d^d)Z&	 	 	 	 d[d_d+Z'	 	 	 	 d[d`d.Z(	 	 	 	 d[d`d/Z)	 	 	 	 d[dad2Z*	 	 	 	 d[dad3Z+	 	 	 	 d[dbd5Z,	 	 	 	 d[dcd6Z-	 	 	 	 d[ddd8Z.	 	 	 	 d[ded9Z/	 	 	 	 d[dfd<Z0	 dgdhdCZ1didFZ2djdLZ3 G dM dNej4                  Z4 G dO dPej5                  Z5 G dQ dej6        ej                  Z6 G dR dSej7                  Z8 G dT dUe9          Z:dkdXZ;dS )la*  
Command-line and common processing for Docutils front-end tools.

This module is provisional.
Major changes will happen with the transition from the
"optparse" module to "arparse" in Docutils 2.0 or later.

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. To be removed.

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.
    )annotationsreStructuredTextN)SUPPRESS_HELP)Path)ioutilsF)IterableMappingSequence)AnyClassVarLiteralProtocol)SettingsSpec_OptionTuple_SettingsSpecTuple)StrPathc                      e Zd Z	 	 dddZdS )_OptionValidatorNconfig_parserConfigParser | Noneconfig_section
str | Nonesettingstrvalueoption_parserOptionParserreturnr   c                   d S N )selfr   r   r   r   r   s         /Users/kimhansen/Desktop/03 Workspace/ceo-agents/chl-effectiveness/mcp-servers/whoop/.venv/lib/python3.11/site-packages/docutils/frontend.py__call__z_OptionValidator.__call__P   s	     C    )NN)r   r   r   r   r   r   r   r   r   r   r   r   )__name__
__module____qualname__r%   r"   r&   r$   r   r   O   s5         26)-		 		 		 		 		 		 		r&   r   optionoptparse.Optionoptr   r   r   parserr   argskwargsr   Nonec                    |D ]}t          |j        |d           |                                D ]\  }}t          |j        ||           dS )a  
    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`.

    Deprecated. Will be removed with the switch to from optparse to argparse.
    N)setattrvaluesitems)r*   r,   r   r-   r.   r/   	attributekeys           r$   store_multipler7   \   sf      0 0	y$////llnn + +
UsE****+ +r&   c                    	 |                     |          }n,# t          $ r}|                    |           Y d}~nd}~ww xY w|j                            ||           dS )z
    Read a configuration file during option processing.  (Option callback.)

    Deprecated. Will be removed with the switch to from optparse to argparse.
    N)get_config_file_settings
ValueErrorerrorr3   update)r*   r,   r   r-   new_settingserrs         r$   read_config_filer?   q   sz    66u==   S
Mv.....s    
A<Ar   r   r   OptionParser | Noner   r   r   c                    || }|dk    rt          j        dt          d           d S 	 t          j        |           n-# t
          $ r  | rd|  dnd}t          | d| d          w xY w|S )	N ztInput encoding detection will be removed and the special encoding values None and "" become invalid in Docutils 1.0.   
stacklevelz	setting "z":z unknown encoding: "")warningswarnFutureWarningcodecslookupLookupError)r   r   r   r   r   prefixs         r$   validate_encodingrN      s     }{{ )*7A	G 	G 	G 	G tCe C C C,3;(W((((VAAAAABBBC Ls	   ? *A)c                z    || }	 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))rJ   lookup_errorrL   r   r   r   r   r   s        r$   validate_encoding_error_handlerrR      sj     }5E"""" 5 5 5, /445 5 	55 Ls    8c                    d|v r^|                     d          \  }}t          |           |r|                    || dz   |           nt          |j        | dz   |           n|}t          |          S )al  Check/normalize encoding settings

    Side-effect: if an error handler is included in the value, it is inserted
    into the appropriate place as if it were a separate setting/option.

    All arguments except `value` are ignored
    (kept for compatibility with "optparse" module).
    If there is only one positional argument, it is interpreted as `value`.
    :_error_handler)splitrR   setr2   r3   rN   )r   r   r   r   r   encodinghandlers          r$   #validate_encoding_and_error_handlerrZ      s      e||!KK,,''000 	Ong8H.H%' ' ' ' M('4D*DgNNNNX&&&r&   
str | boolboolc                    || }t          |t                    r|S 	 t          j        |                                                                         S # t          $ r t          d|z            w xY w)a$  Check/normalize boolean settings:

    :True:  '1', 'on', 'yes', 'true'
    :False: '0', 'off', 'no','false', ''

    All arguments except `value` are ignored
    (kept for compatibility with "optparse" module).
    If there is only one positional argument, it is interpreted as `value`.
    Nzunknown boolean value: "%s")
isinstancer\   r   booleansstriplowerKeyErrorrL   rQ   s        r$   validate_booleanrc      s     }% A$U[[]]%8%8%:%:;; A A A7%?@@@As   5A A0str | bool | Nonec                    || }t          |t                    s||S 	 t          j        |                                                                         S # t          $ r |cY S w xY w)aN  Check/normalize three-value settings:

    :True:  '1', 'on', 'yes', 'true'
    :False: '0', 'off', 'no','false', ''
    :any other value: returned as-is.

    All arguments except `value` are ignored
    (kept for compatibility with "optparse" module).
    If there is only one positional argument, it is interpreted as `value`.
    )r^   r\   r   r_   r`   ra   rb   rQ   s        r$   validate_ternaryrf      st      }% %-$U[[]]%8%8%:%:;;   s   5A A$#A$	str | intintc                V    || }t          |          }|dk     rt          d          |S )Nr   z(negative value; must be positive or zero)rh   r:   rQ   s        r$   validate_nonnegative_intrj     s6     }JJEqyyCDDDLr&   c                    || }	 t          |          S # t          $ rO 	 t          j        |                                         cY S # t
          t          f$ r t          d|z            w xY ww xY w)Nzunknown threshold: %r.)rh   r:   r   
thresholdsra   rb   AttributeErrorrL   rQ   s        r$   validate_thresholdrn     s     }@5zz @ @ @	@*5;;==9999.) 	@ 	@ 	@6>???	@@s     
A.#AA.$A**A.str | list[str]	list[str]c                    || }t          |t                    s|                    d          }n<|                                }|                    |                    d                     |S )NrT   )r^   listrV   popextend)r   r   r   r   r   lasts         r$   $validate_colon_separated_string_listrv   &  sa     }eT"" &C  yy{{TZZ__%%%Lr&   c                    || }t          |t                    s|g}|                                }d |                    d          D             }|                    |           |S )zCheck/normalize list arguments (split at "," and strip whitespace).

    All arguments except `value` are ignored
    (kept for compatibility with "optparse" module).
    If there is only one positional argument, it is interpreted as `value`.
    Nc                b    g | ],}|                     d           |                     d           -S )z 	
)r`   ).0is     r$   
<listcomp>z1validate_comma_separated_list.<locals>.<listcomp>P  s5    KKK!!''':J:JKQWWWKKKr&   ,)r^   rr   rs   rV   rt   )r   r   r   r   r   ru   r4   s          r$   validate_comma_separated_listr}   :  sl     } eT""  99;;DKKtzz#KKKE	LLLr&   tuple[()] | tuple[str, str]c                Z   || }d}d}|sdS |                     d          }|d                                         }	 |d         }	n# t          $ r d}	Y nw xY w||vrt          d	| d
| d          |dk    r0|	                                }
|
|vrt          d|	 d| d          |
}	||	fS )aQ  Check "math-output" setting, return list with "format" and "options".

    See also https://docutils.sourceforge.io/docs/user/config.html#math-output

    Argument list for compatibility with "optparse" module.
    All arguments except `value` are ignored.
    If there is only one positional argument, it is interpreted as `value`.
    N)htmllatexmathmlmathjax)rB   latexmlttm	blahtexmlpandocr"      )maxsplitr   rB   zUnknown math output format: "z",
    choose from .r   zMathML converter "z!" not supported,
    choose from )rV   ra   
IndexErrorrL   )r   r   r   r   r   formatstex2mathml_convertersr3   formatoptions	converters              r$   validate_math_outputr   U  s1    }4GI r[[![$$FAY__F)   W 8% 8 8-48 8 8 9 9 	9MMOO	111 J7 J J1FJ J J K K K7?s   A AAc                J    || }|sdS |                     d          r|S |dz   S )Nz.//)endswithrQ   s        r$   validate_url_trailing_slashr   }  s>     } t			 s{r&   utils.DependencyListc                |    || }	 t          j        |          S # t          $ r t          j        d           cY S w xY wr!   )r   DependencyListOSErrorrQ   s        r$   validate_dependency_filer     sV     }*#E*** * * *#D)))))*s    ;;c                    || }t          |          }|D ]=}t          j                            |          }||k    rt	          d|d|d          >|S )NzInvalid class value z
 (perhaps z?))r}   docutilsnodesmake_idr:   )r   r   r   r   r   cls
normalizeds          r$   validate_strip_classr     s|     })%00E 2 2^++C00
** #ZZZ1 2 2 2  Lr&   !str | list[str | tuple[str, str]]list[tuple[str, Sequence[str]]]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 )	a2  Check/normalize a comma separated list of smart quote definitions.

    Return a list of (language-tag, quotes) string tuples.

    All arguments except `value` are ignored
    (kept for compatibility with "optparse" module).
    If there is only one positional argument, it is interpreted as `value`.
    NrT   r   z4Invalid value "%s". Format is "<language>:<quotes>".asciibackslashreplace   z[Invalid value "%s". Please specify 4 quotes
    (primary open/close; secondary open/close).)r}   rV   rm   appendr:   encoder`   len)
r   r   r   r   r   	lc_quotesitemlangquotesmultichar_quotess
             r$   validate_smartquotes_localesr     sp    })%00E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pathdict"dict[str, list[StrPath] | StrPath]keys
tuple[str]	base_pathStrPath | Nonec                   t          j                    nKt                    t          j        dk    r,t          j        dd         dk    r                                |D ]d}|| v r^| |         }t          |t          t          f          rfd|D             }n&|r$t          |z  
                                          }|| |<   ed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`.
    Nwin32rC   )   	   c                X    g | ]&}t          |z                                            'S r"   )r   resolve)ry   pathr   s     r$   r{   z'make_paths_absolute.<locals>.<listcomp>  s1    KKKTin557788KKKr&   )r   cwdsysplatformversion_infoabsoluter^   rr   tupler   r   )r   r   r   r6   r   s     `  r$   make_paths_absoluter     s     HJJ		OO	<7""s'7';v'E'E!**,,I " "(??SME%$// 9KKKKUKKK 9Yu_557788!HSM" "r&   r   r   c                    t          j        dt          d           t          j                            t          j                            | |                    S )NzKfrontend.make_one_path_absolute() will be removed in Docutils 2.0 or later.rC   rD   )rG   rH   DeprecationWarningosr   abspathjoin)r   r   s     r$   make_one_path_absoluter      sK    M .$4 4 4 4 7??27<<	488999r&   settings_specr   excludereplacer   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.)
    rC   r   c                t    g | ]5}|                     d           |dd                             dd          6S )z--rC   N-_)
startswithr   )ry   
opt_strings     r$   r{   z(filter_settings_spec.<locals>.<listcomp>  sS     8 8 8&%00668
122..sC88 8 8 8r&   r   r   )rr   ranger   r   r   r   )r   r   r   settingsrz   newoptsopt_specopt_names           r$   filter_settings_specr     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                  >     e Zd ZdZdd fdZddZddZd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 when switching to the "argparse" module.
    Ndefaultsdict[str, Any] | Noner   r0   c                    t          j        dt          d           t                                          |           t          | dd           t          j                    | _        d S d S )Nz?frontend.Values class will be removed in Docutils 2.0 or later.rC   rD   r   record_dependencies)	rG   rH   r   super__init__getattrr   r   r   )r#   r   	__class__s     r$   r   zValues.__init__1  su     2(Q	8 	8 	8 	8 	(+++4.55=',';'='=D$$$ >=r&   
other_dictValues | Mapping[str, Any]r   r   c                &   t          |t                    r|j        }t          |          }|j                                        D ]6}t          | |          r$||v r t          | |          }|r|||         z  }||= 7|                     |           d S r!   )	r^   r   __dict__dictlistsr   hasattrr   _update_loose)r#   r   r   r   r   s        r$   r<   zValues.update:  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categoryr   N)rG   catch_warningsfilterwarningsr   r   r   )r#   s    r$   copyzValues.copyI  s    $&& 	: 	:#H7IJJJJ>>4=>99	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	:s   6AAAnamer   defaultr   c                f    t          | |d          t          | ||           t          | |          S )znReturn ``self.name`` or ``default``.

        If ``self.name`` is unset, set ``self.name = default``.
        N)r   r2   )r#   r   r   s      r$   
setdefaultzValues.setdefaultO  s8    
 4t$$,D$(((tT"""r&   r!   )r   r   r   r0   )r   r   r   r   r   r0   r   r   )r   r   r   r   r   r   )	r'   r(   r)   __doc__r   r<   r   r   __classcell__r   s   @r$   r   r   (  s         > > > > > > >' ' ' ': : : :# # # # # # # #r&   r   c                  h     e Zd ZU dZej        j        ddgz   Zded<   ded<   d fdZd fdZ	 xZ
S )Optionz`Add validation and override support to `optparse.Option`.

    Deprecated. Will be removed.
    	validator	overridesr   r   r.   r/   r   r   r0   c                r    t          j        dt          d            t                      j        |i | d S )NzCThe frontend.Option class will be removed in Docutils 2.0 or later.rC   rD   )rG   rH   r   r   r   )r#   r.   r/   r   s      r$   r   zOption.__init__d  sJ     2(Q	8 	8 	8 	8 	$)&)))))r&   r,   r   r   r3   r   r-   r   rh   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_stringr2   r   )
r#   r,   r   r3   r-   resultr   	new_valuer>   r   s
            r$   r  zOption.processj  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   r0   )
r,   r   r   r   r3   r   r-   r   r   rh   )r'   r(   r)   r   r  r   ATTRS__annotations__r   r  r   r   s   @r$   r   r   Y  s          
 O![+$>>E* * * * * *         r&   r   c                      e Zd ZU dZg dZded<   	 dZded<   	 dd	d
dddZded<   	 dddddddddd	Zded<   	  e	e
j        dd          pej        pdZded<   dZded<   ddg d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/d0d1gd2d3d4d5fd6d7d8gd2d9d4d5fd:d;gd2dd4d5fd<d=gd>d?d@fdAdBdCgd(ed)fdDdEgd dFifdGdHgdIedJdKfdLdMgdNd2dOdOdPfdQdRgdNd2dSdTfdUdVgdNd,dWfdXdYgd(dedZfd[d\gd]d,dWfd^d_gd(d`dedafdbdcgd,d`d.fdddegd(ed)fdfdggd,dhd.fdidjgdkdldmednfdodpgdkdqdmednfdrdsdtged	dudvedwfdxdydzgd2ddud5fd{d|d}gd2ddud5fd~dgedddvedfddgd2ddd5fddgedddvedfddgd(ed)fddgd,dd.fddgdddfddgd(dedZfddgdd,dWfddgddedfedgdedfddgddedfedgdedfde dddgdeedfedgeedfdddgddddfddgdeddfddgdddIedfdddgddifdddgddifedgdd>i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dkdedǜfedgdd(ifR fZ	 dddddɜZ	 dZded<   dZdej        ej         xZ!rde! dНpd>de
j"        #                                d         de
j$        dԝZ%ded<   	 	 	 	 dd fdބZ&dd߄Z'e(dd            Z)ddZ*ddZ+ddZ,ddZ-ddZ.ddZ/ xZ0S )r   a  
    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ClassVar[list[str]]standard_config_files)
info1warning2r;   3severe4none5zClassVar[tuple[str]]threshold_choicesr   rC   r   r      )r  r  r;   r  r  zClassVar[dict[str, int]]rl   TF)	r  onyestrue0offnofalserB   zClassVar[dict[str, bool]]r_   rX   Nr   ClassVar[str]default_error_encodingr   $default_error_encoding_error_handlerzGeneral Docutils OptionszaOutput destination name. Obsoletes the <destination> positional argument. Default: None (stdout).z--output-pathz--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-datestampzUBase directory for absolute paths when reading from the local filesystem. Default "".z--root-prefixrB   z<path>)r   r#  z&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-classr   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)r8  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	tracebackzUSpecify the encoding and optionally the error handler of input text.  Default: utf-8.z--input-encodingz<name[:handler]>utf-8)r#  r   r   z--input-encoding-error-handlerstrict)r   r   zWSpecify the text encoding and optionally the error handler for output.  Default: utf-8.z--output-encodingz--output-encoding-error-handlerzSSpecify text encoding and optionally the error handler for error output.  Default: r   z--error-encodingz-ez--error-encoding-error-handlerz<Specify the language (as BCP 47 language tag).  Default: en.z
--languagez-llanguage_codeenz<tag>)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   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_filesr"   ztuple[str, ...]relative_path_settingsgeneralz%prog (Docutils z []z	, Python r   z, on )version_template
componentsIterable[SettingsSpec]r   Mapping[str, Any] | Noneread_config_filesbool | Noner   r0   c                   i | _         	 g | _        	 d| _        t          j        dt
          d            t                      j        |t          dt          j
        d          d| | j        s| j        | _        | g|R | _        |                     | j                   | j                            |pi            |r}| j        d	         sr	 |                                 }n9# t$          $ r,}|                     t)          |                     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<  zThe frontend.OptionParser class will be replaced by a subclass of argparse.ArgumentParser in Docutils 2.0 or later.
  To get default settings, use frontend.get_default_settings().rC   rD   FN   )width)option_classadd_help_option	formatterrH  N)r   config_filesrL  rG   rH   r   r   r   r   r  TitledHelpFormatterrD  rP  rQ  populate_from_componentsr   r<   get_standard_config_settingsr:   r;   r   r   )	r#   rQ  r   rT  r.   r/   config_settingsr>   r   s	           r$   r   zOptionParser.__init__o  s    02
(');&9#L 1		. 	. 	. 	.
 	 '-e#+#?b#I#I#I	* 	*"(	* 	* 	* | 	10DL594GJ4G4G%%do666X^,,, 	;T]3D%E 	;%"&"C"C"E"E % % %

3s88$$$$$$$$%M  !9:::::	; 	; 	; 	;s   C# #
D-"DDc                8   |D ]}||j         }| xj        |j        z  c_        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   rE  r%  r   T)r   rL  r   r   r  OptionGroupadd_option_group
add_optiongetr   r  settings_defaultsr   r<   settings_default_overrides)r#   rQ  	componentr   rz   titledescriptionoption_specgroup	help_textoption_stringsr/   r*   s                r$   r^  z%OptionParser.populate_from_components  s    $ 	F 	FI %3M''9+KK''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&   Sequence[StrPath]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 r"   )r`   r   r   
expanduser)ry   fs     r$   r{   z:OptionParser.get_standard_config_files.<locals>.<listcomp>  s5    III!qwwyyI""1%%IIIr&   )r   environrV   pathsepr  )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&   r   c                .   t          j                    5  t          j        dt                     t	                      }d d d            n# 1 swxY w Y   |                                 D ]+}|                    |                     |          |            ,|S )Nr   r   )rG   r   r   r   r   rw  r<   r9   )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config_filer   dict[str, Any]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   Nr"   )ConfigParserrW   rG   r   r   r   r\  readr   rQ  r   config_section_dependenciesr   addhas_sectionr<   r   r   rL  r   r   dirname)r#   rz  r   appliedr   rh  sections          r$   r9   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r3   r.   rp   c                    |                      |          \  |_        |_        t          |j        | j                   | j        |_        |S )z/Store positional arguments as runtime settings.)
check_argsrI  rJ  r   r   rL  r\  rK  )r#   r3   r.   s      r$   check_valueszOptionParser.check_values  sB    .2ood.C.C++FOT-HIII#0r&   tuple[str | None, str | None]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.)rs   r;   )r#   r.   sourcedestinations       r$   r  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                    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)rG   r   r   r   r   r   r\  rK  )r#   r   s     r$   get_default_valueszOptionParser.get_default_values  s    $&& 	- 	-#H7IJJJJdm,,H	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- "&!2s   0AAAr  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  rb   )r#   r  rl  r*   s       r$   get_option_by_destzOptionParser.get_option_by_dest  si     '4&0 	" 	"E+ " ";$&&!MMMMM '" 3d:;;;r&   )r"   NF)rQ  rR  r   rS  rT  rU  r   r0   )rQ  rR  r   r0   )r   ro  r   )rz  r   r   r{  )r3   r   r.   rp   r   r   )r.   rp   r   r  )r  r   r   r   )1r'   r(   r)   r   r  r  r  rl   r_   r   r   stderrr   _locale_encodingr!  r"  rc   r7   r   rn   rZ   r   rR   r   r?   rv   r   rf  rL  r   r   __version____version_details__detailsrD  rV   r   rP  r   r^  classmethodrw  r_  r9   r  r  r  r  r   r   s   @r$   r   r     s
         2 2 2    
/O O O O OG a!q!,E ,EJ E E E E@ dD55+J +JH J J J J @ 	
J-- 		     
 ;M(LLLL 	#`	 9J
')_)E
G `	 4+	9-
/`	
 ?$
L/?"A "A
B`	 /
LL
N`	 ?T
}z%02 2
3`	 +T
}&:%02 2
3`	" 4
'24 4
5#`	(3
X
.
.
0)`	0 3D
!l1A$C $C
D1`	6 @
Y0
27`	: :
^9; ;
<;`	B A"
#"mg 
 C`	J = 
!"me
L
L
NK`	P 8
 "m
<
<
>Q`	V C!
"!d(* *
+W`	^ <$
%'=
A
A
C_`	d = 
!!?)9; ;
<e`	l 3#
$"O
<
<
>m`	r <
!0@
A
A
Cs`	x C
",<
=
=
?y`	~# )
)'D.BD D	
E`	J# 
.BD D	
EK`	VKt
*;'5),>@ @
AW`	` A
-!(6 8  8
9a`	f @d
&46 6
7g`	l9*"3\"#	$68 8
9m`	v C,=1!-/ /
0w`	|6
):&9)*y+=? ?
@}`	H @+,%57 7
8I`	N -.]GDD
FO`	R :.#3II
KS`	V >/lt)9; ;
<W`	\ 2
{mLL
N]`	`:
(W;= =
>a`	j :;-L
M
M
Ok`	n%
(W;= =
>o`	x ;<-L
M
M
Oy`	|D*@D D Dt
$(5K;= =
>}`	F :;:79 9
:G`	L I
T,3!5 !5
6M`	R 6"
#-E 
S`	Z C,Hh#-;KM M
N[`	` 9
)4
6a`	d -T
Xv.
0e`	j -9b/	:k`	l ,-	3/?	@m`	p +,x.F	Gq`	r ,-,/G	Hs`	t -.<0H	Iu`	v -.<0H	Iw`	x 78'9<> >
?y`	~ ,-,/G	H`	 `	cMH0 -1$()-*.0 0
 /10000NN 	0	0Eo7oooKKKA	'    
 # 796:27(; (; (; (; (; (; (;TK K K K@ J J J [J   ! ! ! !0   # # # #$   < < < < < < < <r&   c                  v     e Zd ZU dZddddZded<   	 dZd	ed
<   dZd	ed<   	 dd fdZddZ	d dZ
d!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)r  stylesheet_path)r  template)pep_stylesheetpep_stylesheet_pathpep_templatez$ClassVar[dict[str, tuple[str, str]]]old_settingsu  The "[option]" section is deprecated.
Support for old-format configuration files will be removed in Docutils 2.0.  Please revise your configuration files.  See <https://docutils.sourceforge.io/docs/user/config.html>, section "Old-Format Configuration Files".r   old_warningzhUnable to read configuration file "%s": content not encoded as UTF-8.
Skipping "%s" configuration file.
not_utf8_errorN	filenamesstr | Sequence[str]r   r@   r   rp   c                   |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 )Nzafrontend.ConfigParser.read(): parameter "option_parser" will be removed in Docutils 2.0 or later.rC   rD   r>  )rX   r   )rG   rH   r   r^   r   r   r~  UnicodeDecodeErrorr   r  writer  handle_old_configvalidate_settings)r#   r  r   read_okry  r   s        r$   r~  zConfigParser.read5  s    $M 6 -< < < < i%% 	$"I! 
	@ 
	@H577<<7<CCC%   
  !4(7K!KLLL D  &&x000(&&x???s   &A&&3BBry  r   r0   c                6   t          j        | j        t          |d           	 t	          | d                   }n# t
          $ r i }Y nw xY w|                     d          s|                     d           |                                D ]z\  }}|| j	        v r;| j	        |         \  }}|                     |          s|                     |           nd}|}| 
                    ||          s|                     |||           {|                     d           d S )Nr   r   rM  )rG   warn_explicitr  ConfigDeprecationWarningr   rb   r  add_sectionr4   r  
has_optionrW   remove_section)r#   ry  r   r6   r   r  r   s          r$   r  zConfigParser.handle_old_configP  sA   t/1I'	, 	, 	,	4	?++GG 	 	 	GGG		** 	(Y'''!--// 		2 		2JCd'''#'#4S#9 ''00 .$$W---#??7G44 2'5111I&&&&&s   9 AA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)sectionsr   r  rb   r   re  r  r:   r   r  rW   r   )	r#   ry  r   r  r   r*   r   r	  r>   s	            r$   r  zConfigParser.validate_settingse  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	optionstrc                R    |                                                     dd          S )z
        Lowercase and transform '-' to '_'.

        So the cmdline form of option names can be used in config files.
        r   r   )ra   r   )r#   r  s     r$   optionxformzConfigParser.optionxform  s$       ((c222r&   r!   )r  r  r   r@   r   rp   )ry  r   r   r0   )ry  r   r   r   r   r0   )r  r   r   r   )r'   r(   r)   r   r  r  r  r  r~  r  r  r  r   r   s   @r$   r}  r}    s         
 
 <E7:9 :9L 9 9 9 9
	4  5 5 5 5%N     37      6' ' ' '*> > > >63 3 3 3 3 3 3 3r&   r}  c                      e Zd ZdZdS )r  z3Warning for deprecated configuration file features.N)r'   r(   r)   r   r"   r&   r$   r  r    s        ====r&   r  rQ  r   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)rG   r   r   r   r   r  )rQ  s    r$   get_default_settingsr    s     
	 	"	" = =3EFFFFJ''::<<= = = = = = = = = = = = = = = = = =s   <AA!$A!)r*   r+   r,   r   r   r   r-   r   r.   r   r/   r   r   r0   )
r*   r+   r,   r   r   r   r-   r   r   r0   )NNNN)r   r   r   r   r   r@   r   r   r   r   r   r   )r   r   r   r   r   r@   r   r   r   r   r   r   )r   r[   r   r   r   r@   r   r   r   r   r   r\   )r   r[   r   r   r   r@   r   r   r   r   r   rd   )r   rg   r   r   r   r@   r   r   r   r   r   rh   )r   ro   r   r   r   r@   r   r   r   r   r   rp   )r   r   r   r   r   r@   r   r   r   r   r   r~   )r   r   r   r   r   r@   r   r   r   r   r   r   )r   r   r   r   r   r@   r   r   r   r   r   r   )r   r   r   r   r   r@   r   r   r   r   r   rp   )r   r   r   r   r   r@   r   r   r   r   r   r   r!   )r   r   r   r   r   r   r   r0   )r   r   r   r   r   r   )r   r   r   r   r   r   r   r   )rQ  r   r   r   )<r   
__future__r   __docformat__rJ   configparserr  r   os.pathr   rG   r   pathlibr   r   r   r   TYPE_CHECKINGcollections.abcr	   r
   r   typingr   r   r   r   r   r   r   docutils.ior   r   r7   r?   rN   rR   rZ   rc   rf   rj   rn   rv   r}   r   r   r   r   r   r   r   r   r   r   r   RawConfigParserr}  rI   r  r  r"   r&   r$   <module>r     s  
. .` # " " " " ""       				  



  " " " " " "                ;;;;;;;;;;777777777777GGGGGGGGGG######
 
 
 
 
8 
 
 
+ + + +*/ / / /$ +/;?;?37	    4 !-1-1%)    2 !-1-1%)' ' ' ' '< *.:>:>26	A A A A A4 *.:>:>26	    6 26BFBF:>	    $ ,0<@<@48	@ @ @ @ @, !-1-1%)    , !-1-1%)    8 .2>B>B6:	% % % % %R 59EIEI=A	    ( 26BFBF:>	* * * * *& .2>B>B6:	    0 !-1-1%)+ + + + +` 59" " " " "4: : : :   @.# .# .# .# .#X_ .# .# .#b* * * * *X_ * * *ZK< K< K< K< K<8((*? K< K< K<\r3 r3 r3 r3 r3</ r3 r3 r3j> > > > >} > > >= = = = = =r&   