Your IP : 18.119.135.67


Current Path : /opt/alt/python310/lib64/python3.10/wsgiref/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/wsgiref/__pycache__/headers.cpython-310.opt-2.pyc

o

6��fn�@s0	ddlZe�d�Zddd�ZGdd�d�ZdS)	�Nz[ \(\)<>@,;:\\"/\[\]\?=]�cCsT	|dur(t|�dkr(|st�|�r"|�dd��dd�}d||fSd||fS|S)Nr�\z\\�"z\"z%s="%s"z%s=%s)�len�	tspecials�search�replace)Zparam�valueZquote�r
�6/opt/alt/python310/lib64/python3.10/wsgiref/headers.py�_formatparam
src@s�eZdZ	d$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|�turtd��||_dS)Nz+Headers must be a list of name/value tuples)�type�list�	TypeError�_headers�_convert_string_type)�selfZheaders�k�vr
r
r�__init__s
zHeaders.__init__cCs$	t|�tur	|Std�t|����)Nz1Header names/values must be of type str (got {0}))r�str�AssertionError�format�repr)rr	r
r
rr)s
�zHeaders._convert_string_typecCs	t|j�S�N)rr�rr
r
r�__len__0s
zHeaders.__len__cCs(	||=|j�|�|�|�|�f�dSr)r�appendr)r�name�valr
r
r�__setitem__4s
�zHeaders.__setitem__cs2	|�������fdd�|jD�|jdd�<dS)Ncs g|]}|d���kr|�qS)r��lower��.0Zkv�rr
r�
<listcomp>@s z'Headers.__delitem__.<locals>.<listcomp>�rr#r�rrr
r&r�__delitem__:s"zHeaders.__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'[s$z#Headers.get_all.<locals>.<listcomp>r(r)r
r&r�get_allRszHeaders.get_allcCs8	|�|���}|jD]\}}|��|kr|Sq|Srr()rr�defaultrrr
r
rr,^s�zHeaders.getcC�	dd�|jD�S)NcSsg|]\}}|�qSr
r
�r%rrr
r
rr'o�z Headers.keys.<locals>.<listcomp>�rrr
r
r�keysg�zHeaders.keyscCr1)NcSsg|]\}}|�qSr
r
r2r
r
rr'yr3z"Headers.values.<locals>.<listcomp>r4rr
r
r�valuesqr6zHeaders.valuescCs	|jdd�Srr4rr
r
r�items{sz
Headers.itemscCsd|jj|jfS)Nz%s(%r))�	__class__�__name__rrr
r
r�__repr__�szHeaders.__repr__cCs 	d�dd�|jD�ddg�S)Nz
cSsg|]}d|�qS)z%s: %sr
r$r
r
rr'�r3z#Headers.__str__.<locals>.<listcomp>�)�joinrrr
r
r�__str__�szHeaders.__str__cCst|��d�S)Nz
iso-8859-1)r�encoderr
r
r�	__bytes__�szHeaders.__bytes__cCs8	|�|�}|dur|j�|�|�|�|�f�|S|Sr)r,rrr)rrr	�resultr
r
r�
setdefault�s
�zHeaders.setdefaultcKs�	g}|dur|�|�}|�|�|��D](\}}|�|�}|dur,|�|�dd��q|�|�}|�t|�dd�|��q|j�|�|�d�|�f�dS)N�_�-z; )rrr8rrrr=)r�_nameZ_valueZ_params�partsrrr
r
r�
add_header�s



 zHeaders.add_headerr)r:�
__module__�__qualname__rrrr!r*r-r.r/r,r5r7r8r;r>r@rBrGr
r
r
rr
s&


	


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



?>