grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026B ¶¿J.ÄJ ~ã@sÒddlmZddlmZmZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z dddddd d d d d dddddddddddgZdZdZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGd d„deƒZGd!d„deƒZGd"d „d eƒZGd#d „d eƒ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)Ú 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@s"eZdZddd„Zdd„ZeZdS)ÚErrorÚcCs||_t ||¡dS)N)ÚmessageÚ ExceptionÚ__init__)ÚselfÚmsg©r"ú1/opt/alt/python37/lib64/python3.7/configparser.pyrªszError.__init__cCs|jS)N)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)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__)NN)r%r&r'rr"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 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__)NN)r%r&r'rr"r"r"r#r×sc@seZdZdd„ZdS)rcCs.t |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òsc@seZdZdd„ZdS)r cCs(t ||¡||_||_|||f|_dS)N)rrr3r)r*)r r3r)r!r"r"r#rs zInterpolationError.__init__N)r%r&r'rr"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})r-r rÚ referencer*)r r3r)Úrawvalr4r!r"r"r#r s  z(InterpolationMissingOptionError.__init__N)r%r&r'rr"r"r"r#r sc@s eZdZdS)r N)r%r&r'r"r"r"r#r sc@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})r-rr rr*)r r3r)r5r!r"r"r#rs z InterpolationDepthError.__init__N)r%r&r'rr"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)Ú 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#r8:s zParsingError.filenamecCstjdtdd�||_dS)NzSThe 'filename' attribute will be removed in future versions. Use 'source' instead.r9)r:)r;r<r=r1)r Úvaluer"r"r#r8Ds cCs*|j ||f¡|jd||f7_dS)Nz [line %2d]: %s)r7r,r)r r2Úliner"r"r#r,NszParsingError.append)NN)r%r&r'rÚpropertyr8Úsetterr,r"r"r"r#r (s   c@seZdZdd„ZdS)rcCs8t |d|||f¡||_||_||_|||f|_dS)Nz7File contains no section headers. file: %r, line: %d %r)rrr1r2r?r*)r r8r2r?r"r"r#rVsz"MissingSectionHeaderError.__init__N)r%r&r'rr"r"r"r#rSsc@s,eZdZdd„Zdd„Zdd„Zdd„Zd S) rcCs|S)Nr")r Úparserr)r3r>Údefaultsr"r"r#Ú before_getjszInterpolation.before_getcCs|S)Nr")r rBr)r3r>r"r"r#Ú before_setmszInterpolation.before_setcCs|S)Nr")r rBr)r3r>r"r"r#Ú before_readpszInterpolation.before_readcCs|S)Nr")r rBr)r3r>r"r"r#Ú before_writesszInterpolation.before_writeN)r%r&r'rDrErFrGr"r"r"r#rgsc@s.eZdZe d¡Zdd„Zdd„Zdd„ZdS) rz %\(([^)]+)\)sc Cs$g}| ||||||d¡d |¡S)Nér)Ú_interpolate_somer0)r rBr)r3r>rCÚLr"r"r#rDˆszBasicInterpolation.before_getcCs<| dd¡}|j d|¡}d|kr8td|| d¡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_setc Csp|j||d|d�}|tkr&t|||ƒ‚�xB|�rj| d¡} | dkrP| |¡dS| dkrv| |d| …¡|| d…}|dd…} | dkr¢| d¡|dd…}q*| dk�rV|j |¡} | dkrÐt||d|ƒ‚| |   d¡¡} ||   ¡d…}y || } Wn&t k �r"t |||| ƒd‚YnXd| k�rJ|  |||| |||d¡n | | ¡q*t||d |fƒ‚q*WdS) NT)ÚrawÚfallbackrKrrHr9ú(z'bad interpolation variable reference %rz/'%%' must be followed by '%%' or '(', found: %r)Úgetrr rOr,rMÚmatchr Ú optionxformÚgroupÚendÚKeyErrorr rI)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#rws c@s.eZdZe d¡Zdd„Zdd„Zdd„ZdS) rz \$\{([^}]+)\}c Cs$g}| ||||||d¡d |¡S)NrHr)rIr0)r rBr)r3r>rCrJr"r"r#rDÅsz ExtendedInterpolation.before_getcCs<| dd¡}|j d|¡}d|kr8td|| d¡fƒ‚|S)Nz$$rú$z1invalid interpolation syntax in %r at position %d)rLrMrNr6rO)r rBr)r3r>rPr"r"r#rEÊs  z ExtendedInterpolation.before_setc Csø|j||d|d�}|tkr&t|||ƒ‚�xÊ|�rò| d¡} | dkrP| |¡dS| dkrv| |d| …¡|| d…}|dd…} | dkr¢| d¡|dd…}q*| dk�rÞ|j |¡} | dkrÐt||d|ƒ‚|  d¡  d ¡} ||   ¡d…}|} |}yrt | ƒdk�r |  | d¡}||}nHt | ƒdk�rV| 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*WdS) NT)rQrRrerrHr9Ú{z'bad interpolation variable reference %rú:)rQzMore than one ':' found: %rz-'$' must be followed by '$' or '{', found: %r)rTrr rOr,rMrUr rWÚsplitrXÚlenrVrYrrr r0rIÚ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@s2eZdZe d¡Zdd„Zdd„Zedd„ƒZ dS) rz%\(([^)]*)\)s|.c Csª|}t}x„|rŒ|d8}|rˆd|krˆtj|j|d�}|j ||¡}y ||}WqŠtk r„} zt|||| jdƒd‚Wdd} ~ XYqŠXq Pq W|r¦d|kr¦t |||ƒ‚|S)NrHz%()rBr) rÚ functoolsÚpartialÚ_interpolation_replacerMrNrYr r*r ) r rBr)r3r>Úvarsr5r]rLÚer"r"r#rDs"  (  zLegacyInterpolation.before_getcCs|S)Nr")r rBr)r3r>r"r"r#rE#szLegacyInterpolation.before_setcCs,| d¡}|dkr| ¡Sd| |¡SdS)NrHz%%(%s)s)rWrV)rUrBÚsr"r"r#rp&s z*LegacyInterpolation._interpolation_replaceN) r%r&r'rcrdrMrDrEÚ staticmethodrpr"r"r"r#r s c s2eZdZdZdZdZeƒZe  eej ¡Z e  ej dd�ej ¡Z e  ej dd�ej ¡Ze  d¡Zddddddddd œZd edfd d 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
[^]]+) # very permissive! \] # ] a› (?P