AlkantarClanX12

Your IP : 3.15.211.41


Current Path : /opt/alt/python39/lib64/python3.9/wsgiref/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/wsgiref/__pycache__/headers.cpython-39.opt-2.pyc

a

R�fn�@s.ddlZe�d�Zddd�ZGdd�d�ZdS)	�Nz[ \(\)<>@,;:\\"/\[\]\?=]�cCsX|durPt|�dkrP|s"t�|�rB|�dd��dd�}d||fSd||fSn|SdS)Nr�\z\\�"z\"z%s="%s"z%s=%s)�len�	tspecials�search�replace)Zparam�valueZquote�r
�4/opt/alt/python39/lib64/python3.9/wsgiref/headers.py�_formatparam
src@s�eZdZd$dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
d%dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�ZdS)&�HeadersNcCs.|dur|ng}t|�tur$td��||_dS)Nz+Headers must be a list of name/value tuples)�type�list�	TypeError�_headers)�selfZheadersr
r
r�__init__s
zHeaders.__init__cCs&t|�tur|Std�t|����dS)Nz1Header names/values must be of type str (got {0}))r�str�AssertionError�format�repr)rr	r
r
r�_convert_string_type)s
�zHeaders._convert_string_typecCs
t|j�S�N)rr�rr
r
r�__len__0szHeaders.__len__cCs&||=|j�|�|�|�|�f�dSr)r�appendr)r�name�valr
r
r�__setitem__4s�zHeaders.__setitem__cs0|�������fdd�|jD�|jdd�<dS)Ncs g|]}|d���kr|�qS)r��lower��.0Zkv�rr
r�
<listcomp>@�z'Headers.__delitem__.<locals>.<listcomp>�rr!r�rrr
r$r�__delitem__:szHeaders.__delitem__cCs
|�|�Sr��getr(r
r
r�__getitem__Bs	zHeaders.__getitem__cCs|�|�duSrr*r(r
r
r�__contains__MszHeaders.__contains__cs"|�������fdd�|jD�S)Ncs$g|]}|d���kr|d�qS)rrr r"r$r
rr%[r&z#Headers.get_all.<locals>.<listcomp>r'r(r
r$r�get_allRszHeaders.get_allcCs6|�|���}|jD]\}}|��|kr|Sq|Srr')rr�default�k�vr
r
rr+^s

zHeaders.getcCsdd�|jD�S)NcSsg|]\}}|�qSr
r
�r#r0r1r
r
rr%or&z Headers.keys.<locals>.<listcomp>�rrr
r
r�keysgszHeaders.keyscCsdd�|jD�S)NcSsg|]\}}|�qSr
r
r2r
r
rr%yr&z"Headers.values.<locals>.<listcomp>r3rr
r
r�valuesqszHeaders.valuescCs|jdd�Srr3rr
r
r�items{sz
Headers.itemscCsd|jj|jfS)Nz%s(%r))�	__class__�__name__rrr
r
r�__repr__�szHeaders.__repr__cCsd�dd�|jD�ddg�S)Nz
cSsg|]}d|�qS)z%s: %sr
r"r
r
rr%�r&z#Headers.__str__.<locals>.<listcomp>�)�joinrrr
r
r�__str__�szHeaders.__str__cCst|��d�S)Nz
iso-8859-1)r�encoderr
r
r�	__bytes__�szHeaders.__bytes__cCs:|�|�}|dur2|j�|�|�|�|�f�|S|SdSr)r+rrr)rrr	�resultr
r
r�
setdefault�s
�zHeaders.setdefaultcKs�g}|dur |�|�}|�|�|��D]P\}}|�|�}|durV|�|�dd��q(|�|�}|�t|�dd�|��q(|j�|�|�d�|�f�dS)N�_�-z; )rrr6rrrr;)r�_nameZ_valueZ_params�partsr0r1r
r
r�
add_header�s



zHeaders.add_header)N)N)r8�
__module__�__qualname__rrrrr)r,r-r.r+r4r5r6r9r<r>r@rEr
r
r
rr
s"


	



r
)Nr)�re�compilerrr
r
r
r
r�<module>
s