Your IP : 3.135.184.124


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

o

6��f�<�@s�	ddlZddlmZddlmZddlmZgd�ZGdd�d�Zdd	�Z	d
d�Z
Gdd
�d
eejd�Ze
Gdd�de��Z
e
�ZdS)�N)�header)�charset)�_has_surrogates)�Policy�Compat32�compat32cs>eZdZ	�fdd�Zdd�Zdd�Zdd�Zd	d
�Z�ZS)�_PolicyBasecsH	|��D]\}}t||�rtt|��||�qtd�||jj���dS�Nz*{!r} is an invalid keyword argument for {})	�items�hasattr�superr�__setattr__�	TypeError�format�	__class__�__name__)�self�kw�name�value�r��8/opt/alt/python310/lib64/python3.10/email/_policybase.py�__init__)s
���z_PolicyBase.__init__cCs*dd�|j��D�}d�|jjd�|��S)NcSsg|]
\}}d�||��qS)z{}={!r})r)�.0rrrrr�
<listcomp>8s�z(_PolicyBase.__repr__.<locals>.<listcomp>z{}({})z, )�__dict__r
rrr�join)r�argsrrr�__repr__7s�z_PolicyBase.__repr__cKst	|j�|j�}|j��D]\}}t�|||�q
|��D]\}}t||�s0td�||jj	���t�|||�q|Sr	)
r�__new__rr
�objectr
rrrr)rrZ	newpolicy�attrrrrr�clone<s
��z_PolicyBase.clonecCs(t||�rd}nd}t|�|jj|���)Nz'{!r} object attribute {!r} is read-onlyz!{!r} object has no attribute {!r})r�AttributeErrorrrr)rrr�msgrrrr
Ns
z_PolicyBase.__setattr__cCs	|jdi|j��S)Nr)r#r)r�otherrrr�__add__Usz_PolicyBase.__add__)	r�
__module__�__qualname__rrr#r
r'�
__classcell__rrrrrsrcCs,|�dd�d}|�dd�d}|d|S)N�
�r)�rsplit�split)�docZ	added_docrrr�_append_doc^sr0cCs�|jr|j�d�rt|jdj|j�|_|j��D]+\}}|jrD|j�d�rDdd�|jD�D]}tt||�d�}|rCt||j�|_nq.q|S)N�+rcss"�|]}|��D]}|VqqdS�N)�mro)r�base�crrr�	<genexpr>hs� z%_extend_docstrings.<locals>.<genexpr>�__doc__)r7�
startswithr0�	__bases__rr
�getattr)�clsrr"r5r/rrr�_extend_docstringscs��r<c@s�eZdZ	dZdZdZdZdZdZdZ	dd�Z
d	d
�Zdd�Ze
jd
d��Ze
jdd��Ze
jdd��Ze
jdd��Ze
jdd��ZdS)rFr+Z8bit�NNTcCs	|jr|�|�||�dSr2)�raise_on_defect�register_defect�r�objZdefectrrr�
handle_defect�szPolicy.handle_defectcCs	|j�|�dSr2)Zdefects�appendr@rrrr?�s
zPolicy.register_defectcCs	dSr2r)rrrrr�header_max_count�szPolicy.header_max_countcC�	t�r2��NotImplementedError)r�sourcelinesrrr�header_source_parse��zPolicy.header_source_parsecCrEr2rF�rrrrrr�header_store_parse�szPolicy.header_store_parsecCrEr2rFrKrrr�header_fetch_parse�szPolicy.header_fetch_parsecCrEr2rFrKrrr�foldszPolicy.foldcCrEr2rFrKrrr�fold_binaryrJzPolicy.fold_binary)rr(r)r>�linesep�cte_type�max_line_length�mangle_from_Zmessage_factoryZverify_generated_headersrBr?rD�abc�abstractmethodrIrLrMrNrOrrrrrps,7

	



r)�	metaclassc@sJeZdZ	dZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)rTcCs,t|t�s|St|�rtj|tj|d�S|S)N�r�header_name)�
isinstance�strrr�Header�_charset�UNKNOWN8BITrKrrr�_sanitize_header!s

�zCompat32._sanitize_headercCs@	|d�dd�\}}|�d�d�|dd��}||�d�fS)Nr�:r,z 	�z
)r.�lstripr�rstrip)rrHrrrrrrI-szCompat32.header_source_parsecCs
	||fSr2rrKrrrrL9szCompat32.header_store_parsecCs	|�||�Sr2)r^rKrrrrM?szCompat32.header_fetch_parsecCs	|j||dd�S)NT��sanitize)�_foldrKrrrrNFsz
Compat32.foldcCs$	|j|||jdkd�}|�dd�S)NZ7bitrc�ascii�surrogateescape)rerQ�encode)rrrZfoldedrrrrOPszCompat32.fold_binarycCs�g}|�d|�t|t�r.t|�r&|rtj|tj|d�}n|�|�d}n
tj||d�}n|}|durId}|jdur>|j}|�|j	|j
|d��|�|j
�d�|�S)Nz%s: rW)rXr)rP�
maxlinelenr`)rCrYrZrrr[r\r]rRrhrPr)rrrrd�parts�hrirrrre\s(
�



zCompat32._foldN)rr(r)rSr^rIrLrMrNrOrerrrrrs
r)rTZemailrrr\Zemail.utilsr�__all__rr0r<�ABCMetarrrrrrr�<module>sL
(
f

?>