a �DOg8��@s�ddlmZddlmZddlZddlZddlZddlZddl Z ddl Z ddl Z gd�Z e ZdZdZGdd�de�ZGd d �d e�ZGd d �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"�$/usr/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#r s �z(InterpolationMissingOptionError.__init__Nr-r"r"r"r#r sr c@s eZdZdS)r N)r&r'r(r"r"r"r#r sr c@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^rhr rj�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 �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