Your IP : 3.145.152.49


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

a

R�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||�r.tt|��||�qtd�||jj���qdS�Nz*{!r} is an invalid keyword argument for {})	�items�hasattr�superr�__setattr__�	TypeError�format�	__class__�__name__)�self�kw�name�value�r��6/opt/alt/python39/lib64/python3.9/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__cKsr|j�|j�}|j��D]\}}t�|||�q|��D]4\}}t||�s^td�||jj	���t�|||�q8|Sr	)
r�__new__rr
�objectr
rrrr)rrZ	newpolicy�attrrrrr�clone<s
��z_PolicyBase.clonecCs,t||�rd}nd}t|�|jj|���dS)Nz'{!r} object attribute {!r} is read-onlyz!{!r} object has no attribute {!r})r�AttributeErrorrrr)rrr�msgrrrr
Ns
z_PolicyBase.__setattr__cCs|jfi|j��S�N)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^sr1cCs�|jr(|j�d�r(t|jdj|j�|_|j��D]V\}}|jr2|j�d�r2dd�|jD�D]*}tt||�d�}|r\t||j�|_q2q\q2|S)N�+rcss |]}|��D]
}|VqqdSr&)�mro)r�base�crrr�	<genexpr>h�z%_extend_docstrings.<locals>.<genexpr>�__doc__)r8�
startswithr1�	__bases__rr
�getattr)�clsrr"r5r0rrr�_extend_docstringscsr=c@s�eZdZdZdZdZdZdZdZdZ	dd�Z
d	d
�Zdd�Ze
jd
d��Ze
jdd��Ze
jdd��Ze
jdd��Ze
jdd��ZdS)rFr,Z8bit�NNTcCs|jr
|�|�||�dSr&)�raise_on_defect�register_defect�r�objZdefectrrr�
handle_defect�szPolicy.handle_defectcCs|j�|�dSr&)Zdefects�appendrArrrr@�szPolicy.register_defectcCsdSr&r)rrrrr�header_max_count�szPolicy.header_max_countcCst�dSr&��NotImplementedError)r�sourcelinesrrr�header_source_parse�szPolicy.header_source_parsecCst�dSr&rF�rrrrrr�header_store_parse�szPolicy.header_store_parsecCst�dSr&rFrJrrr�header_fetch_parse�s	zPolicy.header_fetch_parsecCst�dSr&rFrJrrr�folds
zPolicy.foldcCst�dSr&rFrJrrr�fold_binaryszPolicy.fold_binary)rr)r*r?�linesep�cte_type�max_line_length�mangle_from_Zmessage_factoryZverify_generated_headersrCr@rE�abc�abstractmethodrIrKrLrMrNrrrrrps(9

	



r)�	metaclassc@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)rTcCs0t|t�s|St|�r(tj|tj|d�S|SdS)N�r�header_name)�
isinstance�strrr�Header�_charset�UNKNOWN8BITrJrrr�_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||fSr&rrJrrrrK9szCompat32.header_store_parsecCs|�||�Sr&)r]rJrrrrL?szCompat32.header_fetch_parsecCs|j||dd�S)NT��sanitize)�_foldrJrrrrMFsz
Compat32.foldcCs"|j|||jdkd�}|�dd�S)NZ7bitrb�ascii�surrogateescape)rdrP�encode)rrrZfoldedrrrrNPs	zCompat32.fold_binarycCs�g}|�d|�t|t�r\t|�rL|r<tj|tj|d�}qZ|�|�d}q`tj||d�}n|}|dur�d}|jdur||j}|�|j	|j
|d��|�|j
�d�|�S)Nz%s: rV)rWr)rO�
maxlinelenr_)rDrXrYrrrZr[r\rQrgrOr)rrrrc�parts�hrhrrrrd\s(
�


zCompat32._foldN)rr)r*rRr]rIrKrLrMrNrdrrrrrs
r)rSZemailrrr[Zemail.utilsr�__all__rr1r=�ABCMetarrrrrrr�<module>sL
(f

?>