Your IP : 3.21.12.122


Current Path : /opt/alt/python35/lib64/python3.5/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/__pycache__/configparser.cpython-35.opt-2.pyc



���]���@s�ddlmZddlmZmZddlZddlZddl	Z	ddl
Z
ddlZddlZdddddd	d
ddd
dddddddddddgZ
dZdZGdd�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�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&dS)0�)�MutableMapping)�OrderedDict�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@s1eZdZddd�Zdd�ZeZdS)�Error�cCs||_tj||�dS)N)�message�	Exception�__init__)�self�msg�r"�1/opt/alt/python35/lib64/python3.5/configparser.pyr�s	zError.__init__cCs|jS)N)r)r r"r"r#�__repr__�szError.__repr__N)�__name__�
__module__�__qualname__rr$�__str__r"r"r"r#r�src@seZdZdd�ZdS)rcCs0tj|d|f�||_|f|_dS)NzNo section: %r)rr�section�args)r r)r"r"r#r�s	zNoSectionError.__init__N)r%r&r'rr"r"r"r#r�sc@s"eZdZdddd�ZdS)rNcCs�t|�dg}|dk	rudt|�g}|dk	rR|jdj|��|jd�|j|�|}n|jdd�tj|dj|��||_||_	||_
|||f|_dS)Nz already existszWhile reading from z [line {0:2d}]z
: section rzSection r)�repr�append�format�extend�insertrr�joinr)�source�linenor*)r r)r1r2r!rr"r"r#r�s

				zDuplicateSectionError.__init__)r%r&r'rr"r"r"r#r�sc@s"eZdZdddd�ZdS)rNcCs�t|�dt|�dg}|dk	r�dt|�g}|dk	r^|jdj|��|jd�|j|�|}n|jdd�tj|dj|��||_||_	||_
||_||||f|_dS)	Nz in section z already existszWhile reading from z [line {0:2d}]z	: option rzOption r)
r+r,r-r.r/rrr0r)�optionr1r2r*)r r)r3r1r2r!rr"r"r#r�s 	

					zDuplicateOptionError.__init__)r%r&r'rr"r"r"r#r�sc@seZdZdd�ZdS)rcCs?tj|d||f�||_||_||f|_dS)NzNo option %r in section: %r)rrr3r)r*)r r3r)r"r"r#r�s
		zNoOptionError.__init__N)r%r&r'rr"r"r"r#r�sc@seZdZdd�ZdS)r	cCs8tj||�||_||_|||f|_dS)N)rrr3r)r*)r r3r)r!r"r"r#r�s		zInterpolationError.__init__N)r%r&r'rr"r"r"r#r	�sc@seZdZdd�ZdS)rcCsPdj||||�}tj||||�||_||||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})r-r	r�	referencer*)r r3r)�rawvalr4r!r"r"r#r	s
	z(InterpolationMissingOptionError.__init__N)r%r&r'rr"r"r"r#rsc@seZdZdS)rN)r%r&r'r"r"r"r#rsc@seZdZdd�ZdS)r
cCsDdj||t|�}tj||||�|||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})r-rr	rr*)r r3r)r5r!r"r"r#rs
		z InterpolationDepthError.__init__N)r%r&r'rr"r"r"r#r
sc@sUeZdZdddd�Zedd��Zejdd��Zdd�ZdS)	r
NcCsz|r|rtd��n)|r8|r8td��n|rD|}tj|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)�
ValueErrorrrr1�errorsr*)r r1�filenamer"r"r#r*s		zParsingError.__init__cCstjdtdd�|jS)NzSThe 'filename' attribute will be removed in future versions.  Use 'source' instead.�
stacklevel�)�warnings�warn�DeprecationWarningr1)r r"r"r#r89s
zParsingError.filenamecCs#tjdtdd�||_dS)NzSThe 'filename' attribute will be removed in future versions.  Use 'source' instead.r9r:)r;r<r=r1)r �valuer"r"r#r8Cs
cCs3|jj||f�|jd||f7_dS)Nz
	[line %2d]: %s)r7r,r)r r2�liner"r"r#r,MszParsingError.append)r%r&r'r�propertyr8�setterr,r"r"r"r#r
's

c@seZdZdd�ZdS)rcCsNtj|d|||f�||_||_||_|||f|_dS)Nz7File contains no section headers.
file: %r, line: %d
%r)rrr1r2r?r*)r r8r2r?r"r"r#rUs			z"MissingSectionHeaderError.__init__N)r%r&r'rr"r"r"r#rRsc@s@eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rcCs|S)Nr")r �parserr)r3r>�defaultsr"r"r#�
before_getiszInterpolation.before_getcCs|S)Nr")r rBr)r3r>r"r"r#�
before_setlszInterpolation.before_setcCs|S)Nr")r rBr)r3r>r"r"r#�before_readoszInterpolation.before_readcCs|S)Nr")r rBr)r3r>r"r"r#�before_writerszInterpolation.before_writeN)r%r&r'rDrErFrGr"r"r"r#rfsc@sCeZdZejd�Zdd�Zdd�Zdd�ZdS)	rz
%\(([^)]+)\)scCs2g}|j||||||d�dj|�S)N�r)�_interpolate_somer0)r rBr)r3r>rC�Lr"r"r#rD�szBasicInterpolation.before_getcCsV|jdd�}|jjd|�}d|krRtd||jd�f��|S)Nz%%r�%z1invalid interpolation syntax in %r at position %d)�replace�_KEYCRE�subr6�find)r rBr)r3r>�	tmp_valuer"r"r#rE�szBasicInterpolation.before_setcCs�|j||ddd|�}|tkr<t|||��x�|r�|jd�}	|	dkrq|j|�dS|	dkr�|j|d|	��||	d�}|dd�}
|
dkr�|jd�|dd�}q?|
dkr�|jj|�}|dkr t||d	|��|j|j	d��}||j
�d�}y||}
Wn*tk
r�t||||�d�YnXd|
kr�|j
||||
|||d�q�|j|
�q?t||d
|f��q?WdS)N�rawT�fallbackrKrrHr:�(z'bad interpolation variable reference %rz/'%%' must be followed by '%%' or '(', found: %r)�getrr
rOr,rM�matchr�optionxform�group�end�KeyErrorrrI)r rBr3�accum�restr)�map�depthr5�p�c�m�var�vr"r"r#rI�sF	

	

z$BasicInterpolation._interpolate_someN)	r%r&r'�re�compilerMrDrErIr"r"r"r#rvsc@sCeZdZejd�Zdd�Zdd�Zdd�ZdS)	rz
\$\{([^}]+)\}cCs2g}|j||||||d�dj|�S)NrHr)rIr0)r rBr)r3r>rCrJr"r"r#rD�sz ExtendedInterpolation.before_getcCsV|jdd�}|jjd|�}d|krRtd||jd�f��|S)Nz$$r�$z1invalid interpolation syntax in %r at position %d)rLrMrNr6rO)r rBr)r3r>rPr"r"r#rE�sz ExtendedInterpolation.before_setcCs�|j||ddd|�}|tkr<t|||��xg|r�|jd�}	|	dkrq|j|�dS|	dkr�|j|d|	��||	d�}|dd�}
|
dkr�|jd�|dd�}q?|
dkr�|jj|�}|dkr t||d	|��|jd�j	d
�}||j
�d�}|}
|}y�t|�dkr�|j|d�}||}nct|�dkr�|d}
|j|d�}|j|
|dd�}nt||d|f��Wn<t
ttfk
r1t|||d
j|��d�YnXd|kry|j|||||
t|j|
dd��|d�q�|j|�q?t||d|f��q?WdS)
NrQTrRrerrHr:�{z'bad interpolation variable reference %r�:zMore than one ':' found: %rz-'$' must be followed by '$' or '{', found: %r)rTrr
rOr,rMrUrrW�splitrX�lenrVrYrrrr0rI�dict�items)r rBr3rZr[r)r\r]r5r^r_r`�pathZsect�optrbr"r"r#rI�s^	

	


#z'ExtendedInterpolation._interpolate_someN)	r%r&r'rcrdrMrDrErIr"r"r"r#r�sc@sIeZdZejd�Zdd�Zdd�Zedd��Z	dS)	rz%\(([^)]*)\)s|.c
Cs�|}t}x�|r�|d8}|r�d|kr�tj|jd|�}|jj||�}y||}Wq�tk
r�}	z$t||||	jd�d�WYdd}	~	Xq�XqPqW|r�d|kr�t	|||��|S)NrHz%(rBr)
r�	functools�partial�_interpolation_replacerMrNrYrr*r
)
r rBr)r3r>�varsr5r]rL�er"r"r#rDs"	
	2zLegacyInterpolation.before_getcCs|S)Nr")r rBr)r3r>r"r"r#rE"szLegacyInterpolation.before_setcCs:|jd�}|dkr%|j�Sd|j|�SdS)NrHz%%(%s)s)rWrV)rUrB�sr"r"r#rp%s
z*LegacyInterpolation._interpolation_replaceN)
r%r&r'rcrdrMrDrE�staticmethodrpr"r"r"r#rscsjeZdZdZdZdZe�Zej	eej
�Zej	ejdd�ej
�Z
ej	ejdd�ej
�Zej	d�Zddd	dd
ddddd
dd
dd
dd
iZded
dduddvdddddddedededd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zdd*d+�Zdd,d-�Zd.d/d0�Zd1d2d3�Zdd4d5�Zd6d
d7dd8ed9d:�Zd;d<�Z d6d
d7dd8ed=d>�Z!d6d
d7dd8ed?d@�Z"d6d
d7dd8edAdB�Z#d6d
d7dd8edCdD�Z$ed
d�fdEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(ddMdN�Z)ddOdP�Z*dQdR�Z+dSdT�Z,dUdV�Z-dWdX�Z.dYdZ�Z/d[d\�Z0d]d^�Z1d_d`�Z2dadb�Z3dcdd�Z4dedf�Z5dgdh�Z6didj�Z7dkdl�Z8dmdndodndpdndqdr�Z9e:dsdt��Z;�S)wrz�
        \[                                 # [
        (?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
        �delimz=|:z\S�1T�yes�trueZon�0F�no�falseZoffN�
delimiters�=rg�comment_prefixes�#�;�inline_comment_prefixes�strict�empty_lines_in_values�default_section�
interpolation�
converterscCs�||_|j�|_|j�|_t|�|_|j�|_t||	�|j|	<|r�x0|j�D]"\}}
|
|j|j|�<qnWt	|�|_
|dkr�|r�|jn|j|_
nsdjdd�|D��}|rtj|jjd|�tj�|_
n'tj|jjd|�tj�|_
t	|pLf�|_t	|paf�|_||_||_||_|	|_|
|_|jtkr�|j|_|jdkr�t�|_|tk	r�|jj|�dS)Nr}rg�|css|]}tj|�VqdS)N)rc�escape)�.0�dr"r"r#�	<genexpr>ksz+RawConfigParser.__init__.<locals>.<genexpr>ru)r}rg) �_dict�	_sections�	_defaultsr�_converters�_proxiesrrkrV�tuple�_delimiters�	OPTCRE_NV�OPTCRE�_optcrer0rcrd�_OPT_NV_TMPLr-�VERBOSE�	_OPT_TMPL�_comment_prefixes�_inline_comment_prefixes�_strict�_allow_no_value�_empty_lines_in_valuesr��_interpolation�_UNSET�_DEFAULT_INTERPOLATIONr�update)r rCZ	dict_typeZallow_no_valuer|r~r�r�r�r�r�r��keyr>r�r"r"r#rWs>						zRawConfigParser.__init__cCs|jS)N)r�)r r"r"r#rC�szRawConfigParser.defaultscCst|jj��S)N)�listr��keys)r r"r"r#�sections�szRawConfigParser.sectionscCsg||jkrtd|��||jkr:t|��|j�|j|<t||�|j|<dS)NzInvalid section name: %r)r�r6r�rr�rr�)r r)r"r"r#�add_section�szRawConfigParser.add_sectioncCs
||jkS)N)r�)r r)r"r"r#�has_section�szRawConfigParser.has_sectioncCs[y|j|j�}Wn!tk
r:t|�d�YnX|j|j�t|j��S)N)r��copyrYrr�r�r�r�)r r)Zoptsr"r"r#�options�s
zRawConfigParser.optionscCs�t|t�r|g}g}xc|D][}y0t|d|��}|j||�WdQRXWntk
rrw%YnX|j|�q%W|S)N�encoding)�
isinstance�str�open�_read�OSErrorr,)r �	filenamesr�Zread_okr8�fpr"r"r#�read�s	

zRawConfigParser.readcCsH|dkr4y
|j}Wntk
r3d}YnX|j||�dS)Nz<???>)�name�AttributeErrorr�)r �fr1r"r"r#�	read_file�s

zRawConfigParser.read_filez<string>cCs#tj|�}|j||�dS)N)�io�StringIOr�)r �stringr1Zsfiler"r"r#�read_string�szRawConfigParser.read_stringz<dict>cCs$t�}x|j�D]\}}t|�}y|j|�Wn0ttfk
rq|jrm||krm�YnX|j|�x�|j�D]�\}}|jt|��}|dk	r�t|�}|jr�||f|kr�t	|||��|j||f�|j|||�q�WqWdS)N)
�setrkr�r�rr6r��addrVr)r Z
dictionaryr1�elements_addedr)r�r�r>r"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.r9r:r1)r;r<r=r�)r r�r8r"r"r#�readfp�s
zRawConfigParser.readfprQrqrRcCs�y|j||�}Wn(tk
r@|tkr8�n|SYnX|j|�}y||}Wn4tk
r�|tkr�t||��n|SYnX|s�|dkr�|S|jj|||||�SdS)N)�
_unify_valuesrr�rVrYrr�rD)r r)r3rQrqrRr�r>r"r"r#rT�s"
	
	zRawConfigParser.getcKs||j|||��S)N)rT)r r)�convr3�kwargsr"r"r#�_getszRawConfigParser._getcKsXy&|j|||d|d||�SWn+ttfk
rS|tkrK�|SYnXdS)NrQrq)r�rrr�)r r)r3r�rQrqrRr�r"r"r#�	_get_conv"szRawConfigParser._get_convcKs(|j||td|d|d||�S)NrQrqrR)r��int)r r)r3rQrqrRr�r"r"r#�getint-szRawConfigParser.getintcKs(|j||td|d|d||�S)NrQrqrR)r��float)r r)r3rQrqrRr�r"r"r#�getfloat2szRawConfigParser.getfloatcKs+|j|||jd|d|d||�S)NrQrqrR)r��_convert_to_boolean)r r)r3rQrqrRr�r"r"r#�
getboolean7szRawConfigParser.getbooleanc
s��tkrt�j�S�jj��y�j�j��Wn-tk
ro��jkrkt	���YnX|r�x-|j�D]\}}|��j
|�<q�W���fdd��|r��fdd���fdd��j�D�S)Ncs �jj��|�|��S)N)r�rD)r3)r�r)r r"r#�<lambda>Ssz'RawConfigParser.items.<locals>.<lambda>cs�|S)Nr")r3)r�r"r#r�Vscs"g|]}|�|�f�qSr"r")r�r3)�value_getterr"r#�
<listcomp>Ws	z)RawConfigParser.items.<locals>.<listcomp>)r��superrkr�r�r�r�rYr�rrVr�)r r)rQrqr�r>)�	__class__)r�r)r r�r#rk<s

zRawConfigParser.itemscCs9x,|j�D]}||}||=||fSWt�dS)N)r�rY)r r�r>r"r"r#�popitemYs

zRawConfigParser.popitemcCs
|j�S)N)�lower)r Z	optionstrr"r"r#rVfszRawConfigParser.optionxformcCsx|s||jkr2|j|�}||jkS||jkrEdS|j|�}||j|kps||jkSdS)NF)r�rVr�r�)r r)r3r"r"r#�
has_optionis
zRawConfigParser.has_optioncCs�|r!|jj||||�}|s7||jkrC|j}n5y|j|}Wn!tk
rwt|�d�YnX|||j|�<dS)N)r�rEr�r�r�rYrrV)r r)r3r>�sectdictr"r"r#r�ws	
zRawConfigParser.setcCs�|rdj|jd�}n
|jd}|jrW|j||j|jj�|�x4|jD])}|j|||j|j�|�qaWdS)Nz {} r)r-r�r��_write_sectionr�rkr�)r r�Zspace_around_delimitersr�r)r"r"r#�write�s
	zRawConfigParser.writecCs�|jdj|��x�|D]{\}}|jj||||�}|dk	sZ|jry|t|�jdd�}nd}|jdj||��qW|jd�dS)Nz[{}]
�
z
	rz{}{}
)r�r-r�rGr�r�rL)r r�Zsection_nameZ
section_items�	delimiterr�r>r"r"r#r��s	zRawConfigParser._write_sectioncCs�|s||jkr"|j}n5y|j|}Wn!tk
rVt|�d�YnX|j|�}||k}|r||=|S)N)r�r�r�rYrrV)r r)r3r��existedr"r"r#�
remove_option�s
zRawConfigParser.remove_optioncCs-||jk}|r)|j|=|j|=|S)N)r�r�)r r)r�r"r"r#�remove_section�s


zRawConfigParser.remove_sectioncCs6||jkr+|j|�r+t|��|j|S)N)r�r�rYr�)r r�r"r"r#�__getitem__�szRawConfigParser.__getitem__cCsV||jkr|jj�n ||jkr?|j|j�|j||i�dS)N)r�r��clearr�r�)r r�r>r"r"r#�__setitem__�s
zRawConfigParser.__setitem__cCsG||jkrtd��|j|�s6t|��|j|�dS)Nz"Cannot remove the default section.)r�r6r�rYr�)r r�r"r"r#�__delitem__�s
zRawConfigParser.__delitem__cCs||jkp|j|�S)N)r�r�)r r�r"r"r#�__contains__�szRawConfigParser.__contains__cCst|j�dS)NrH)rir�)r r"r"r#�__len__�szRawConfigParser.__len__cCstj|jf|jj��S)N)�	itertools�chainr�r�r�)r r"r"r#�__iter__�szRawConfigParser.__iter__cCsFt�}d}d}d}d}d}d}	x�t|dd�D]�\}}
tj}dd�|jD�}x�|tjkr|ri}
x�|j�D]v\}}|
j||d�}|dkr�q�||
|<|dks�|dkr�|
|dj�r�t||�}q�W|
}qnWx-|j	D]"}|
j
�j|�r$d}Pq$W|tjkr_d}|
d|�j
�}|s�|jr�|dkr�|dk	r�|r�||dk	r�||j
d�q@tj}q@|jj|
�}|r�|j�nd}|dk	r.|r.||kr.||j
|�q@|}|jj|�}|r|jd�}||jkr�|jr�||kr�t|||��|j|}|j|�nW||jkr�|j}n<|j�}||j|<t||�|j|<|j|�d}q@|dkr/t|||
��q@|jj|�}|r|jdd	d
�\}}}|s�|j|	|||
�}	|j |j!��}|jr�||f|kr�t"||||��|j||f�|dk	r|j
�}|g||<q(d||<q@|j|	|||
�}	q@W|j#�|	rB|	�dS)Nr�startrHcSsi|]}d|�qS)rH���r")r�r^r"r"r#�
<dictcomp>�s	z)RawConfigParser._read.<locals>.<dictcomp>r�headerr3�vir>r�)$r��	enumerate�sys�maxsizer�rkrO�isspace�minr��strip�
startswithr�r,�NONSPACECRE�searchr��SECTCRErUrWr�r�rr�r�r�r�rr�rr��
_handle_errorrV�rstripr�_join_multiline_values)r r��fpnamer�ZcursectZsectnameZoptnamer2Zindent_levelrrr?Z
comment_startZinline_prefixesZ
next_prefixes�prefix�indexr>Zfirst_nonspaceZcur_indent_level�mor�Zoptvalr"r"r#r��s�		
,
				


			

zRawConfigParser._readcCs�|j|jf}tj|f|jj��}xt|D]l\}}x]|j�D]O\}}t|t�r�dj|�j	�}|j
j||||�||<qPWq7WdS)Nr�)r�r�r�r�r�rkr�r�r0r�r�rF)r rCZall_sectionsr)r�r��valr"r"r#r�Vsz&RawConfigParser._join_multiline_valuescCs,|st|�}|j|t|��|S)N)r
r,r+)r �excr�r2r?r"r"r#r�bszRawConfigParser._handle_errorc
Cs�i}y|j|}Wn-tk
rF||jkrBt|��YnXi}|r�xE|j�D]7\}}|dk	r�t|�}|||j|�<q`Wt|||j�S)N)	r�rYr�rrkr�rV�	_ChainMapr�)r r)rqZsectiondictZvardictr�r>r"r"r#r�hs
zRawConfigParser._unify_valuescCs6|j�|jkr%td|��|j|j�S)NzNot a boolean: %s)r��BOOLEAN_STATESr6)r r>r"r"r#r�|sz#RawConfigParser._convert_to_booleanr)rr3r>cCset|t�std��t|t�s6td��|jsF|rat|t�satd��dS)Nzsection names must be stringszoption keys must be stringszoption values must be strings)r�r��	TypeErrorr�)r r)r3r>r"r"r#�_validate_value_types�s
z%RawConfigParser._validate_value_typescCs|jS)N)r�)r r"r"r#r��szRawConfigParser.converters)r}rg)rr�)<r%r&r'Z
_SECT_TMPLr�r�rr�rcrdr�r�r-r�r�r�r��
_default_dictrr�rrCr�r�r�r�r�r�r�r�r�rTr�r�r�r�r�rkr�rVr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r@r�r"r")r�r#r.st		!!$		%


zcs@eZdZe�Zd�fdd�Z�fdd�Z�S)rNcs0|jd|d|�t�j|||�dS)Nr3r>)r�r�r�)r r)r3r>)r�r"r#r��szConfigParser.setcs$|jd|�t�j|�dS)Nr))r�r�r�)r r))r�r"r#r��szConfigParser.add_section)r%r&r'rr�r�r�r"r")r�r#r�s	cs"eZdZ�fdd�Z�S)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.r9r:)r�rr;r<r=)r r*r�)r�r"r#r�szSafeConfigParser.__init__)r%r&r'rr"r")r�r#r�sc	@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zedd��Z
edd��Zddddddddd�ZdS)rcCse||_||_xL|jD]A}d|}tj|jdt||��}t|||�qWdS)NrT�_impl)�_parser�_namer�rnrorT�getattr�setattr)r rBr�r�r��getterr"r"r#r�s		
!zSectionProxy.__init__cCsdj|j�S)Nz
<Section: {}>)r-r)r r"r"r#r$�szSectionProxy.__repr__cCs:|jj|j|�s$t|��|jj|j|�S)N)rr�rrYrT)r r�r"r"r#r��szSectionProxy.__getitem__cCs2|jjd|d|�|jj|j||�S)Nr3r>)rr�r�r)r r�r>r"r"r#r��szSectionProxy.__setitem__cCs@|jj|j|�o-|jj|j|�s<t|��dS)N)rr�rr�rY)r r�r"r"r#r��szSectionProxy.__delitem__cCs|jj|j|�S)N)rr�r)r r�r"r"r#r��szSectionProxy.__contains__cCst|j��S)N)ri�_options)r r"r"r#r��szSectionProxy.__len__cCs|j�j�S)N)rr�)r r"r"r#r��szSectionProxy.__iter__cCs9|j|jjkr(|jj|j�S|jj�SdS)N)rrr�r�rC)r r"r"r#r�szSectionProxy._optionscCs|jS)N)r)r r"r"r#rB�szSectionProxy.parsercCs|jS)N)r)r r"r"r#r��szSectionProxy.nameNrQFrqrc
Ks7|s|jj}||j|d|d|d||�S)NrQrqrR)rrTr)r r3rRrQrqrr�r"r"r#rT�s
zSectionProxy.get)r%r&r'rr$r�r�r�r�r�r�rr@rBr�rTr"r"r"r#r�s	c@sgeZdZejd�Zdd�Zdd�Zdd�Zdd	�Z	d
d�Z
dd
�ZdS)rz^get(?P<name>.+)$cCs{||_i|_xbt|j�D]Q}|jj|�}|s"tt|j|��r]q"d|j|jd�<q"WdS)Nr�)r�_data�dir�	GETTERCRErU�callablerrW)r rBrr`r"r"r#r
s		 zConverterMapping.__init__cCs|j|S)N)r)r r�r"r"r#r�szConverterMapping.__getitem__c
Cs�yd|}Wn0tk
r@tdj|t|����YnX|dkrYtd��||j|<tj|jjd|�}||_	t
|j||�x?|jj�D].}tj|jd|�}t
|||�q�WdS)NrTzIncompatible key: {} (type: {})z)Incompatible key: cannot use "" as a namer�r)
r�r6r-�typerrnrorr��	converterr�valuesrT)r r�r>�k�func�proxyrr"r"r#r�s
	
	zConverterMapping.__setitem__cCs�yd|pd}Wntk
r4t|��YnX|j|=xRtj|jf|jj��D]/}yt||�Wqatk
r�waYqaXqaWdS)NrT)	r�rYrr�r�rr�delattrr�)r r�r�instr"r"r#r�)s

(
zConverterMapping.__delitem__cCs
t|j�S)N)�iterr)r r"r"r#r�7szConverterMapping.__iter__cCs
t|j�S)N)rir)r r"r"r#r�:szConverterMapping.__len__N)r%r&r'rcrdr
rr�r�r�r�r�r"r"r"r#rs	)'�collections.abcr�collectionsrrrr�rnr�r�rcr�r;�__all__rrrrrrrrr	rrr
r
r�objectr�rrrrrrrrrr"r"r"r#�<module>�sP					
	

+	HJ&��q
F

?>