AlkantarClanX12

Your IP : 18.217.140.224


Current Path : /proc/self/root/opt/alt/python39/lib64/python3.9/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python39/lib64/python3.9/__pycache__/configparser.cpython-39.opt-2.pyc

a

R�f8��@s�ddlmZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZgd�Ze
ZdZdZGdd�de�ZGd	d
�d
e�ZGdd�de�ZGd
d�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�Ze�ZGdd�d�ZGdd �d e�Z Gd!d"�d"e�Z!Gd#d$�d$e�Z"Gd%d&�d&e�Z#Gd'd(�d(e#�Z$Gd)d*�d*e$�Z%Gd+d,�d,e�Z&Gd-d.�d.e�Z'dS)/�)�MutableMapping)�ChainMapN)�NoSectionError�DuplicateOptionError�DuplicateSectionError�
NoOptionError�InterpolationError�InterpolationDepthError�InterpolationMissingOptionError�InterpolationSyntaxError�ParsingError�MissingSectionHeaderError�ConfigParser�SafeConfigParser�RawConfigParser�
Interpolation�BasicInterpolation�ExtendedInterpolation�LegacyInterpolation�SectionProxy�ConverterMapping�DEFAULTSECT�MAX_INTERPOLATION_DEPTHZDEFAULT�
c@s"eZdZddd�Zdd�ZeZdS)�Error�cCs||_t�||�dS�N)�message�	Exception�__init__)�self�msg�r"�1/opt/alt/python39/lib64/python3.9/configparser.pyr�szError.__init__cCs|jSr)r�r r"r"r#�__repr__�szError.__repr__N)r)�__name__�
__module__�__qualname__rr%�__str__r"r"r"r#r�s
rc@seZdZdd�ZdS)rcCs$t�|d|f�||_|f|_dS)NzNo section: %r)rr�section�args�r r*r"r"r#r�szNoSectionError.__init__N�r&r'r(rr"r"r"r#r�src@seZdZddd�ZdS)rNcCs�t|�dg}|durRdt|�g}|dur8|�d�|��|�d�|�|�|}n|�dd�t�|d�|��||_||_	||_
|||f|_dS)N� already exists�While reading from � [line {0:2d}]z
: section rzSection r)�repr�append�format�extend�insertrr�joinr*�source�linenor+)r r*r7r8r!rr"r"r#r�s

zDuplicateSectionError.__init__)NNr-r"r"r"r#r�src@seZdZddd�ZdS)rNcCs�t|�dt|�dg}|durZdt|�g}|dur@|�d�|��|�d�|�|�|}n|�dd�t�|d�|��||_||_	||_
||_||||f|_dS)	Nz in section r.r/r0z	: option rzOption r)
r1r2r3r4r5rrr6r*�optionr7r8r+)r r*r9r7r8r!rr"r"r#r�s"�

zDuplicateOptionError.__init__)NNr-r"r"r"r#r�src@seZdZdd�ZdS)rcCs.t�|d||f�||_||_||f|_dS)NzNo option %r in section: %r�rrr9r*r+)r r9r*r"r"r#r�s�zNoOptionError.__init__Nr-r"r"r"r#r�src@seZdZdd�ZdS)rcCs(t�||�||_||_|||f|_dSrr:)r r9r*r!r"r"r#rszInterpolationError.__init__Nr-r"r"r"r#r�src@seZdZdd�ZdS)r
cCs8d�||||�}t�||||�||_||||f|_dS)Nz�Bad value substitution: option {!r} in section {!r} contains an interpolation key {!r} which is not a valid option name. Raw value: {!r})r3rr�	referencer+)r r9r*�rawvalr;r!r"r"r#rs�z(InterpolationMissingOptionError.__init__Nr-r"r"r"r#r
sr
c@seZdZdS)rN)r&r'r(r"r"r"r#rsrc@seZdZdd�ZdS)r	cCs0d�||t|�}t�||||�|||f|_dS)Nz�Recursion limit exceeded in value substitution: option {!r} in section {!r} contains an interpolation key which cannot be substituted in {} steps. Raw value: {!r})r3rrrr+)r r9r*r<r!r"r"r#rs�z InterpolationDepthError.__init__Nr-r"r"r"r#r	sr	c@s8eZdZd	dd�Zedd��Zejdd��Zdd�ZdS)
rNcCsT|r|rtd��n|s$|s$td��n|r,|}t�|d|�||_g|_|f|_dS)Nz:Cannot specify both `filename' and `source'. Use `source'.z%Required argument `source' not given.z"Source contains parsing errors: %r)�
ValueErrorrrr7�errorsr+)r r7�filenamer"r"r#r,s

zParsingError.__init__cCstjdtdd�|jS�NzSThe 'filename' attribute will be removed in future versions.  Use 'source' instead.���
stacklevel��warnings�warn�DeprecationWarningr7r$r"r"r#r?;s
�zParsingError.filenamecCstjdtdd�||_dSr@rD�r �valuer"r"r#r?Es
�cCs*|j�||f�|jd||f7_dS)Nz
	[line %2d]: %s)r>r2r)r r8�liner"r"r#r2OszParsingError.append)NN)r&r'r(r�propertyr?�setterr2r"r"r"r#r)s

	
	rc@seZdZdd�ZdS)r
cCs8t�|d|||f�||_||_||_|||f|_dS)Nz7File contains no section headers.
file: %r, line: %d
%r)rrr7r8rJr+)r r?r8rJr"r"r#rWs��z"MissingSectionHeaderError.__init__Nr-r"r"r"r#r
Tsr
c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rcCs|Srr")r �parserr*r9rI�defaultsr"r"r#�
before_getkszInterpolation.before_getcCs|Srr"�r rMr*r9rIr"r"r#�
before_setnszInterpolation.before_setcCs|Srr"rPr"r"r#�before_readqszInterpolation.before_readcCs|Srr"rPr"r"r#�before_writetszInterpolation.before_writeN)r&r'r(rOrQrRrSr"r"r"r#rhsrc@s.eZdZe�d�Zdd�Zdd�Zdd�ZdS)	rz
%\(([^)]+)\)sc	Cs$g}|�||||||d�d�|�S�N�r��_interpolate_somer6�r rMr*r9rIrN�Lr"r"r#rO�szBasicInterpolation.before_getcCs<|�dd�}|j�d|�}d|vr8td||�d�f��|S)Nz%%r�%�1invalid interpolation syntax in %r at position %d��replace�_KEYCRE�subr=�find�r rMr*r9rIZ	tmp_valuer"r"r#rQ�s�zBasicInterpolation.before_setc
Csh|j||d|d�}|tkr&t|||��|�rd|�d�}	|	dkrL|�|�dS|	dkrr|�|d|	��||	d�}|dd�}
|
dkr�|�d�|dd�}q&|
dk�rP|j�|�}|dur�t||d|��|�|�	d��}||�
�d�}z||}
Wn$t�yt||||�d�Yn0d|
v�rD|�
||||
|||d�n
|�|
�q&t||d	|f��q&dS)
NT��raw�fallbackrZrrUrA�(�'bad interpolation variable reference %rz/'%%' must be followed by '%%' or '(', found: %r)�getrr	r`r2r^�matchr�optionxform�group�end�KeyErrorr
rW)r rMr9�accum�restr*�map�depthr<�p�c�m�var�vr"r"r#rW�sT



���

���z$BasicInterpolation._interpolate_someN�	r&r'r(�re�compiler^rOrQrWr"r"r"r#rxs
rc@s.eZdZe�d�Zdd�Zdd�Zdd�ZdS)	rz
\$\{([^}]+)\}c	Cs$g}|�||||||d�d�|�SrTrVrXr"r"r#rO�sz ExtendedInterpolation.before_getcCs<|�dd�}|j�d|�}d|vr8td||�d�f��|S)Nz$$r�$r[r\rar"r"r#rQ�s�z ExtendedInterpolation.before_setcCs�|j||d|d�}|tkr&t|||��|�r�|�d�}	|	dkrL|�|�dS|	dkrr|�|d|	��||	d�}|dd�}
|
dkr�|�d�|dd�}q&|
dk�r�|j�|�}|dur�t||d|��|�d��	d	�}||�
�d�}|}
|}zrt|�dk�r|�|d�}||}nHt|�dk�rR|d}
|�|d�}|j|
|dd
�}nt||d|f��Wn0t
ttf�y�t|||d	�|��d�Yn0d|v�r�|�|||||
t|j|
dd
��|d�n
|�|�q&t||d|f��q&dS)
NTrbryrrUrA�{rf�:)rczMore than one ':' found: %rz-'$' must be followed by '$' or '{', found: %r)rgrr	r`r2r^rhrrj�splitrk�lenrirlrrr
r6rW�dict�items)r rMr9rmrnr*rorpr<rqrrrs�pathZsect�optrur"r"r#rW�sn



�
���
���z'ExtendedInterpolation._interpolate_someNrvr"r"r"r#r�s
rc@s2eZdZe�d�Zdd�Zdd�Zedd��Z	dS)	rz%\(([^)]*)\)s|.c

Cs�|}t}|r�|d8}|r�d|vr�tj|j|d�}|j�||�}z||}Wq�ty�}	z"t||||	jd�d�WYd}	~	q�d}	~	00qq�q|r�d|vr�t	|||��|S)NrUz%()rMr)
r�	functools�partial�_interpolation_replacer^r_rlr
r+r	)
r rMr*r9rI�varsr<rpr]�er"r"r#rOs*���zLegacyInterpolation.before_getcCs|Srr"rPr"r"r#rQ$szLegacyInterpolation.before_setcCs,|�d�}|dur|��Sd|�|�SdS)NrUz%%(%s)s)rjri)rhrM�sr"r"r#r�'s
z*LegacyInterpolation._interpolation_replaceN)
r&r'r(rwrxr^rOrQ�staticmethodr�r"r"r"r#r
s

rc
s2eZdZdZdZdZe�Ze�	eej
�Ze�	ejdd�ej
�Z
e�	ejdd�ej
�Ze�	d�Zddddddddd	�Zd
edfddd
ddeeed
�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdcdd�Zdddd�Zdedd �Zdfd"d#�Zdgd$d%�Zdd
ed&�d'd(�Zd)d*�Z dd
ed&�d+d,�Z!dd
ed&�d-d.�Z"dd
ed&�d/d0�Z#dd
ed&�d1d2�Z$edd
f�fd3d4�	Z%d5d6�Z&d7d8�Z'd9d:�Z(dhd;d<�Z)did=d>�Z*d?d@�Z+dAdB�Z,dCdD�Z-dEdF�Z.dGdH�Z/dIdJ�Z0dKdL�Z1dMdN�Z2dOdP�Z3dQdR�Z4dSdT�Z5dUdV�Z6dWdX�Z7dYdZ�Z8d[d\�Z9d]d]d]d^�d_d`�Z:e;dadb��Z<�Z=S)jrz�
        \[                                 # [
        (?P<header>[^]]+)                  # very permissive!
        \]                                 # ]
        a�
        (?P<option>.*?)                    # very permissive!
        \s*(?P<vi>{delim})\s*              # any number of space/tab,
                                           # followed by any of the
                                           # allowed delimiters,
                                           # followed by any space/tab
        (?P<value>.*)$                     # everything up to eol
        a�
        (?P<option>.*?)                    # very permissive!
        \s*(?:                             # any number of space/tab,
        (?P<vi>{delim})\s*                 # optionally followed by
                                           # any of the allowed
                                           # delimiters, followed by any
                                           # space/tab
        (?P<value>.*))?$                   # everything up to eol
        z=|:�Zdelimz\STF)�1Zyes�trueZon�0ZnoZfalseZoffN��=r{)�#�;)�
delimiters�comment_prefixes�inline_comment_prefixes�strict�empty_lines_in_values�default_section�
interpolation�
convertersc
Cs<||_|��|_|��|_t|�|_|��|_t||	�|j|	<t|�|_|dkrd|rZ|j	n|j
|_nNd�dd�|D��}|r�t
�|jj|d�t
j�|_nt
�|jj|d�t
j�|_t|p�d�|_t|p�d�|_||_||_||_|	|_|
|_|jtur�|j|_|jdu�rt�|_|tu�r(|j�|�|�r8|�|�dS)Nr��|css|]}t�|�VqdSr)rw�escape)�.0�dr"r"r#�	<genexpr>j�z+RawConfigParser.__init__.<locals>.<genexpr>r�r")�_dict�	_sections�	_defaultsr�_converters�_proxiesr�tuple�_delimiters�	OPTCRE_NV�OPTCRE�_optcrer6rwrx�_OPT_NV_TMPLr3�VERBOSE�	_OPT_TMPL�_comment_prefixes�_inline_comment_prefixes�_strict�_allow_no_value�_empty_lines_in_valuesr��_interpolation�_UNSET�_DEFAULT_INTERPOLATIONr�update�_read_defaults)
r rNZ	dict_typeZallow_no_valuer�r�r�r�r�r�r�r�r�r"r"r#rYs@




��

zRawConfigParser.__init__cCs|jSr)r�r$r"r"r#rN�szRawConfigParser.defaultscCst|j���Sr)�listr��keysr$r"r"r#�sections�szRawConfigParser.sectionscCsJ||jkrtd|��||jvr(t|��|��|j|<t||�|j|<dS)NzInvalid section name: %r)r�r=r�rr�rr�r,r"r"r#�add_section�s

zRawConfigParser.add_sectioncCs
||jvSr)r�r,r"r"r#�has_section�szRawConfigParser.has_sectioncCsHz|j|��}Wnty.t|�d�Yn0|�|j�t|���Sr)r��copyrlrr�r�r�r�)r r*Zoptsr"r"r#�options�szRawConfigParser.optionsc	Cs�t|tttjf�r|g}g}|D]x}z<t||d��}|�||�Wd�n1sT0YWntyvYq Yn0t|tj�r�t�|�}|�	|�q |S)N)�encoding)
�
isinstance�str�bytes�os�PathLike�open�_read�OSError�fspathr2)r �	filenamesr�Zread_okr?�fpr"r"r#�read�s.

zRawConfigParser.readcCs:|dur*z
|j}Wnty(d}Yn0|�||�dS)Nz<???>)�name�AttributeErrorr�)r �fr7r"r"r#�	read_file�s

zRawConfigParser.read_file�<string>cCst�|�}|�||�dSr)�io�StringIOr�)r �stringr7Zsfiler"r"r#�read_string�s
zRawConfigParser.read_string�<dict>c
Cs�t�}|��D]�\}}t|�}z|�|�Wn&ttfyR|jrN||vrN�Yn0|�|�|��D]`\}}|�t|��}|dur�t|�}|jr�||f|vr�t	|||��|�||f�|�|||�qfqdSr)
�setrr�r�rr=r��addrir)r Z
dictionaryr7�elements_addedr*r��keyrIr"r"r#�	read_dict�s"

zRawConfigParser.read_dictcCs"tjdtdd�|j||d�dS)NzRThis method will be removed in future versions.  Use 'parser.read_file()' instead.rArB)r7)rErFrGr�)r r�r?r"r"r#�readfp�s
�zRawConfigParser.readfp�rcr�rdcCs�z|�||�}Wn&ty6|tur*�n|YSYn0|�|�}z||}Wn.ty||turpt||��n|YSYn0|s�|dur�|S|j�|||||�SdSr)�
_unify_valuesrr�rirlrr�rO)r r*r9rcr�rdr�rIr"r"r#rg�s$
�zRawConfigParser.getcKs||j||fi|���Sr)rg)r r*�convr9�kwargsr"r"r#�_get"szRawConfigParser._getc	KsHz|j|||f||d�|��WSttfyB|tur:�|YS0dS)N)rcr�)r�rrr�)r r*r9r�rcr�rdr�r"r"r#�	_get_conv%s�zRawConfigParser._get_convcKs|j||tf|||d�|��S�Nr�)r��int�r r*r9rcr�rdr�r"r"r#�getint0s
��zRawConfigParser.getintcKs|j||tf|||d�|��Sr�)r��floatr�r"r"r#�getfloat5s
��zRawConfigParser.getfloatcKs |j|||jf|||d�|��Sr�)r��_convert_to_booleanr�r"r"r#�
getboolean:s
��zRawConfigParser.getbooleancs��turt���S�j���z���j��Wn$tyT��jkrPt	���Yn0t
����}|r�|��D]\}}|���|�<qn���fdd��|r��fdd���fdd�|D�S)Ncs�j���|�|��Sr)r�rO�r9)r�r*r r"r#�<lambda>Ws�z'RawConfigParser.items.<locals>.<lambda>cs�|Srr"r�)r�r"r#r�Zr�csg|]}|�|�f�qSr"r")r�r9)�value_getterr"r#�
<listcomp>[r�z)RawConfigParser.items.<locals>.<listcomp>)
r��superrr�r�r�r�rlr�rr�r�ri)r r*rcr�Z	orig_keysr�rI��	__class__)r�r*r r�r#r?s 


zRawConfigParser.itemscCs.|��D]}||}||=||fSt�dSr)r�rl�r r�rIr"r"r#�popitem]s
zRawConfigParser.popitemcCs|��Sr)�lower)r Z	optionstrr"r"r#rijszRawConfigParser.optionxformcCsV|r||jkr"|�|�}||jvS||jvr0dS|�|�}||j|vpP||jvSdS)NF)r�rir�r�)r r*r9r"r"r#�
has_optionms



�zRawConfigParser.has_optioncCsj|r|j�||||�}|r$||jkr,|j}n,z|j|}WntyVt|�d�Yn0|||�|�<dSr)r�rQr�r�r�rlrri)r r*r9rI�sectdictr"r"r#r�{s�zRawConfigParser.setcCsh|rd�|jd�}n
|jd}|jr>|�||j|j��|�|jD]}|�|||j|��|�qDdS)Nz {} r)r3r�r��_write_sectionr�rr�)r r�Zspace_around_delimitersr�r*r"r"r#�write�s	


�
�zRawConfigParser.writecCsx|�d�|��|D]T\}}|j�||||�}|dus<|jsR|t|��dd�}nd}|�d�||��q|�d�dS)Nz[{}]
�
z
	rz{}{}
)r�r3r�rSr�r�r])r r�Zsection_nameZ
section_itemsZ	delimiterr�rIr"r"r#r��s�zRawConfigParser._write_sectioncCsb|r||jkr|j}n,z|j|}Wnty@t|�d�Yn0|�|�}||v}|r^||=|Sr)r�r�r�rlrri)r r*r9r��existedr"r"r#�
remove_option�s
zRawConfigParser.remove_optioncCs"||jv}|r|j|=|j|=|Sr)r�r�)r r*r�r"r"r#�remove_section�s

zRawConfigParser.remove_sectioncCs&||jkr|�|�st|��|j|Sr)r�r�rlr��r r�r"r"r#�__getitem__�szRawConfigParser.__getitem__cCsX||vr|||urdS||jkr.|j��n||jvrF|j|��|�||i�dSr)r�r��clearr�r�r�r"r"r#�__setitem__�s

zRawConfigParser.__setitem__cCs2||jkrtd��|�|�s$t|��|�|�dS)Nz"Cannot remove the default section.)r�r=r�rlr�r�r"r"r#�__delitem__�s


zRawConfigParser.__delitem__cCs||jkp|�|�Sr)r�r�r�r"r"r#�__contains__�szRawConfigParser.__contains__cCst|j�dS)NrU)r}r�r$r"r"r#�__len__�szRawConfigParser.__len__cCst�|jf|j���Sr)�	itertools�chainr�r�r�r$r"r"r#�__iter__�szRawConfigParser.__iter__cCs t�}d}d}d}d}d}d}	t|dd�D�]�\}}
tj}dd�|jD�}|tjkr�|r�i}
|��D]T\}}|
�||d�}|dkr�qd||
|<|dks�|dkrd|
|d��rdt||�}qd|
}qJ|j	D]}|
�
��|�r�d}q�q�|tjkr�d}|
d|��
�}|�sN|j�rF|du�rL|du�rL|�rL||du�rL||�
d�q*tj}q*|j�|
�}|�rh|��nd}|du�r�|�r�||k�r�||�
|�q*|}|j�|�}|�r<|�d�}||jv�r�|j�r�||v�r�t|||��|j|}|�|�n@||jk�r
|j}n,|��}||j|<t||�|j|<|�|�d}q*|du�rTt|||
��q*|j�|�}|�r�|�d	d
d�\}}}|�s�|�|	|||
�}	|� |�!��}|j�r�||f|v�r�t"||||��|�||f�|du�r�|�
�}|g||<nd||<q*|�|	|||
�}	q*|�#�|	�r|	�dS)NrrU)�startcSsi|]
}|d�qS)���r")r�rqr"r"r#�
<dictcomp>�r�z)RawConfigParser._read.<locals>.<dictcomp>rr�headerr9�virI)$r��	enumerate�sys�maxsizer�rr`�isspace�minr��strip�
startswithr�r2�NONSPACECRE�searchr�SECTCRErhrjr�r�rr�r�r�r�rr�r
r��
_handle_errorri�rstripr�_join_multiline_values)r r��fpnamer�ZcursectZsectnameZoptnamer8Zindent_levelr�rJZ
comment_startZinline_prefixesZ
next_prefixes�prefix�indexrIZfirst_nonspaceZcur_indent_levelZmorZoptvalr"r"r#r��s� 


��
��
�




��

zRawConfigParser._readcCsr|j|jf}t�|f|j���}|D]H\}}|��D]6\}}t|t�rTd�|��	�}|j
�||||�||<q4q$dS)Nr�)r�r�rrr�rr�r�r6rr�rR)r rNZall_sectionsr*r�r��valr"r"r#r^s�
�z&RawConfigParser._join_multiline_valuescCs&|��D]\}}||j|�|�<qdSr)rr�ri)r rNr�rIr"r"r#r�jszRawConfigParser._read_defaultscCs |st|�}|�|t|��|Sr)rr2r1)r �excrr8rJr"r"r#rpszRawConfigParser._handle_errorcCs�i}z|j|}Wn&ty8||jkr4t|�d�Yn0i}|rr|��D]&\}}|durbt|�}|||�|�<qJt|||j�Sr)	r�rlr�rrr�ri�	_ChainMapr�)r r*r�ZsectiondictZvardictr�rIr"r"r#r�vs
zRawConfigParser._unify_valuescCs(|��|jvrtd|��|j|��S)NzNot a boolean: %s)r��BOOLEAN_STATESr=rHr"r"r#r��sz#RawConfigParser._convert_to_booleanr)r*r9rIcCsDt|t�std��t|t�s$td��|jr.|r@t|t�s@td��dS)Nzsection names must be stringszoption keys must be stringszoption values must be strings)r�r��	TypeErrorr��r r*r9rIr"r"r#�_validate_value_types�s



z%RawConfigParser._validate_value_typescCs|jSr)r�r$r"r"r#r��szRawConfigParser.converters)N)N)r�)r�)N)N)T)>r&r'r(Z
_SECT_TMPLr�r�rr�rwrxr�rr3r�r�rr�
_default_dictrr�rrNr�r�r�r�r�r�r�r�r�rgr�r�r�r�r�rr�rir�r�r�r�r�r�r�r�r�r�rrr�rr�rr�r�rrKr��
__classcell__r"r"r�r#r0s�

���(	




	%����




zrcs8eZdZe�Zd�fdd�	Z�fdd�Zdd�Z�ZS)	rNcs"|j||d�t��|||�dS�N)r9rI)rr�r�rr�r"r#r��szConfigParser.setcs|j|d�t��|�dS)N)r*)rr�r�r,r�r"r#r��szConfigParser.add_sectioncCs6z(|j}t�|_|�|j|i�W||_n||_0dSr)r�rr�r�)r rNZhold_interpolationr"r"r#r��s
zConfigParser._read_defaults)N)	r&r'r(rr�r�r�r�r!r"r"r�r#r�srcseZdZ�fdd�Z�ZS)rcs&t�j|i|��tjdtdd�dS)Nz�The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead.rArB)r�rrErFrG)r r+r�r�r"r#r�s
�zSafeConfigParser.__init__)r&r'r(rr!r"r"r�r#r�src@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zedd��Z
edd��Zddddd�dd�ZdS)rcCsF||_||_|jD].}d|}tj|jt||�d�}t|||�qdS)Nrg��_impl)�_parser�_namer�r�r�rg�getattr�setattr)r rMr�r�r��getterr"r"r#r�s
zSectionProxy.__init__cCsd�|j�S)Nz
<Section: {}>)r3r&r$r"r"r#r%�szSectionProxy.__repr__cCs(|j�|j|�st|��|j�|j|�Sr)r%r�r&rlrgr�r"r"r#r��szSectionProxy.__getitem__cCs"|jj||d�|j�|j||�Sr")r%rr�r&r�r"r"r#r��szSectionProxy.__setitem__cCs,|j�|j|�r |j�|j|�s(t|��dSr)r%r�r&r�rlr�r"r"r#r��s�zSectionProxy.__delitem__cCs|j�|j|�Sr)r%r�r&r�r"r"r#r��szSectionProxy.__contains__cCst|���Sr)r}�_optionsr$r"r"r#r�szSectionProxy.__len__cCs|����Sr)r*rr$r"r"r#r�szSectionProxy.__iter__cCs*|j|jjkr|j�|j�S|j��SdSr)r&r%r�r�rNr$r"r"r#r*�szSectionProxy._optionscCs|jSr)r%r$r"r"r#rMszSectionProxy.parsercCs|jSr)r&r$r"r"r#r�	szSectionProxy.nameNF)rcr�r$cKs(|s|jj}||j|f|||d�|��Sr�)r%rgr&)r r9rdrcr�r$r�r"r"r#rgs
��zSectionProxy.get)N)r&r'r(rr%r�r�r�r�rrr*rKrMr�rgr"r"r"r#r�s 	

�rc@sFeZdZe�d�Zdd�Zdd�Zdd�Zdd	�Z	d
d�Z
dd
�ZdS)rz^get(?P<name>.+)$cCsR||_i|_t|j�D]6}|j�|�}|rtt|j|��s<qd|j|�d�<qdS)Nr�)r%�_data�dir�	GETTERCRErh�callabler'rj)r rMr)rsr"r"r#r(szConverterMapping.__init__cCs
|j|Sr)r+r�r"r"r#r�1szConverterMapping.__getitem__c	Cs�zd|}Wn&ty2td�|t|����Yn0|dkrDtd��||j|<tj|jj|d�}||_	t
|j||�|j��D] }tj|j|d�}t
|||�q~dS)NrgzIncompatible key: {} (type: {})z)Incompatible key: cannot use "" as a name)r�r#)
rr=r3�typer+r�r�r%r�Z	converterr(�valuesrg)r r�rI�k�func�proxyr)r"r"r#r�4s�
zConverterMapping.__setitem__c	Cszzd|p
d}Wnty*t|��Yn0|j|=t�|jf|j���D]*}zt||�WqJtyrYqJYqJ0qJdS)Nrg)	rrlr+rrr%r0�delattrr�)r r�r1�instr"r"r#r�DszConverterMapping.__delitem__cCs
t|j�Sr)�iterr+r$r"r"r#rRszConverterMapping.__iter__cCs
t|j�Sr)r}r+r$r"r"r#rUszConverterMapping.__len__N)r&r'r(rwrxr-rr�r�r�rrr"r"r"r#rs
	r)(�collections.abcr�collectionsrrr�r�rr�rwr
rE�__all__r~r rrrrrrrrrr
rr	rr
�objectr�rrrrrrrrrr"r"r"r#�<module>�sL	
	

+HJ& 
F