Your IP : 18.226.169.169


Current Path : /usr/lib64/python3.8/__pycache__/
Upload File :
Current File : //usr/lib64/python3.8/__pycache__/configparser.cpython-38.opt-2.pyc

U

e5df��@s�ddlmZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZdddddd	d
ddd
dddddddddddgZe
ZdZdZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGd d�de�ZGd!d�de�ZGd"d
�d
e�ZGd#d�de�ZGd$d	�d	e�ZGd%d�de�ZGd&d
�d
e�Ze�ZGd'd�d�ZGd(d�de�Z Gd)d�de�Z!Gd*d�de�Z"Gd+d�de�Z#Gd,d�de#�Z$Gd-d�de$�Z%Gd.d�de�Z&Gd/d�de�Z'dS)0�)�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"�$/usr/lib64/python3.8/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�sc@seZdZddd�ZdS)rNcCs�t|�dg}|dk	rRdt|�g}|dk	r8|�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�sc@seZdZddd�ZdS)rNcCs�t|�dt|�dg}|dk	rZdt|�g}|dk	r@|�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�sc@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�sc@seZdZdd�ZdS)rcCs(t�||�||_||_|||f|_dSrr:)r r9r*r!r"r"r#rszInterpolationError.__init__Nr-r"r"r"r#r�sc@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
sc@seZdZdS)rN)r&r'r(r"r"r"r#rsc@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	sc@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

	
	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
Tsc@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#rhsc@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|kr8td||�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
Csj|j||d|d�}|tkr&t|||��|�rf|�d�}	|	dkrL|�|�dS|	dkrr|�|d|	��||	d�}|dd�}
|
dkr�|�d�|dd�}q&|
dk�rR|j�|�}|dkr�t||d|��|�|�	d��}||�
�d�}z||}
Wn&tk
�rt||||�d�YnXd|
k�rF|�
||||
|||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�s`



���
���z$BasicInterpolation._interpolate_someN�	r&r'r(�re�compiler^rOrQrWr"r"r"r#rxs
c@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|kr8td||�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�|�}|dkr�t||d|��|�d��	d	�}||�
�d�}|}
|}zrt|�dk�r|�|d�}||}nHt|�dk�rR|d}
|�|d�}|j|
|dd
�}nt||d|f��Wn2t
ttfk
�r�t|||d	�|��d�YnXd|k�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�sx



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

Cs�|}t}|r�|d8}|r�d|kr�tj|j|d�}|j�||�}z||}Wq�tk
r�}	zt||||	jd�d�W5d}	~	XYq�Xqq�q|r�d|kr�t	|||��|S)NrUz%()rMr)
r�	functools�partial�_interpolation_replacer^r_rlr
r+r	)
r rMr*r9rI�varsr<rpr]�er"r"r#rOs0���zLegacyInterpolation.before_getcCs|Srr"rPr"r"r#rQ$szLegacyInterpolation.before_setcCs,|�d�}|dkr|��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

c
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�|_||_||_||_|	|_|
|_|jtkr�|j|_|jdk�rt�|_|tk	�r(|j�|�|�r8|�|�dS)Nr��|css|]}t�|�VqdSr)rw�escape)�.0�dr"r"r#�	<genexpr>jsz+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|��||jkr(t|��|��|j|<t||�|j|<dS)NzInvalid section name: %r)r�r=r�rr�rr�r,r"r"r#�add_section�s

zRawConfigParser.add_sectioncCs
||jkSr)r�r,r"r"r#�has_section�szRawConfigParser.has_sectioncCsJz|j|��}Wntk
r0t|�d�YnX|�|j�t|���Sr)r��copyrlrr�r�r�r�)r r*Zoptsr"r"r#�options�szRawConfigParser.optionsc
Cs�t|tttjf�r|g}g}|D]f}z(t||d��}|�||�W5QRXWntk
rdYq YnXt|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<|dkr,z
|j}Wntk
r*d}YnX|�||�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(ttfk
rT|jrP||krP�YnX|�|�|��D]`\}}|�t|��}|dk	r�t|�}|jr�||f|kr�t	|||��|�||f�|�|||�qhqdSr)
�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(tk
r8|tkr,�n|YSYnX|�|�}z||}Wn0tk
r�|tkrtt||��n|YSYnX|s�|dkr�|S|j�|||||�SdSr)�
_unify_valuesrr�rirlrr�rO)r r*r9rcr�rdr�rIr"r"r#rg�s$
�zRawConfigParser.getcKs||j||f|��Sr)rg)r r*�convr9�kwargsr"r"r#�_get"szRawConfigParser._getc	KsJz|j|||f||d�|��WSttfk
rD|tkr<�|YSXdS)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��tkrt���S�j���z���j��Wn&tk
rV��jkrRt	���YnXt
����}|r�|��D]\}}|���|�<qp���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�Z�csg|]}|�|�f�qSr"r")r�r9)�value_getterr"r#�
<listcomp>[sz)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"|�|�}||jkS||jkr0dS|�|�}||j|kpP||jkSdS)NF)r�rir�r�)r r*r9r"r"r#�
has_optionms



�zRawConfigParser.has_optioncCsl|r|j�||||�}|r$||jkr,|j}n.z|j|}Wntk
rXt|�d�YnX|||�|�<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�||||�}|dk	s<|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_sectioncCsd|r||jkr|j}n.z|j|}Wntk
rBt|�d�YnX|�|�}||k}|r`||=|Sr)r�r�r�rlrri)r r*r9r��existedr"r"r#�
remove_option�s
zRawConfigParser.remove_optioncCs"||jk}|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||kr|||krdS||jkr.|j��n||jkrF|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|dk�rL|dk	�rL|�rL||dk	�rL||�
d�q*tj}q*|j�|
�}|�rh|��nd}|dk	�r�|�r�||k�r�||�
|�q*|}|j�|�}|�r<|�d�}||jk�r�|j�r�||k�r�t|||��|j|}|�|�n@||jk�r
|j}n,|��}||j|<t||�|j|<|�|�d}q*|dk�rTt|||
��q*|j�|�}|�r�|�d	d
d�\}}}|�s�|�|	|||
�}	|� |�!��}|j�r�||f|k�r�t"||||��|�||f�|dk	�r�|�
�}|g||<nd||<q*|�|	|||
�}	q*|�#�|	�r|	�dS)NrrU)�startcSsi|]
}|d�qS)���r")r�rqr"r"r#�
<dictcomp>�sz)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�gszRawConfigParser._read_defaultscCs |st|�}|�|t|��|Sr)rr2r1)r �excrr8rJr"r"r#rmszRawConfigParser._handle_errorcCs�i}z|j|}Wn(tk
r:||jkr6t|�d�YnXi}|rt|��D]&\}}|dk	rdt|�}|||�|�<qLt|||j�Sr)	r�rlr�rrr�ri�	_ChainMapr�)r r*r�ZsectiondictZvardictr�rIr"r"r#r�ss
zRawConfigParser._unify_valuescCs(|��|jkrtd|��|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cs8eZdZe�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_sectioncCs0z"|j}t�|_|�|j|i�W5||_XdSr)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cseZdZ�fdd�Z�ZS)rcs"t�j||�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�sc@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 	

�c@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�.szConverterMapping.__getitem__c	Cs�zd|}Wn(tk
r4td�|t|����YnX|dkrFtd��||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�1s �
zConverterMapping.__setitem__c	Cs~zd|p
d}Wntk
r,t|��YnX|j|=t�|jf|j���D],}zt||�WqLtk
rvYqLYqLXqLdS)Nrg)	rrlr+rrr%r0�delattrr�)r r�r1�instr"r"r#r�AszConverterMapping.__delitem__cCs
t|j�Sr)�iterr+r$r"r"r#rOszConverterMapping.__iter__cCs
t|j�Sr)r}r+r$r"r"r#rRszConverterMapping.__len__N)r&r'r(rwrxr-rr�r�r�rrr"r"r"r#rs
	)(Zcollections.abcr�collectionsrrr�r�rr�rwr
rE�__all__r~r rrrrrrrrrr
rr	rr
�objectr�rrrrrrrrrr"r"r"r#�<module>�sp�	
	

+HJ&| 
F

?>