Your IP : 18.226.169.169


Current Path : /opt/alt/python35/lib64/python3.5/email/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/email/__pycache__/policy.cpython-35.opt-2.pyc



���];(�@sddlZddlmZmZmZmZddlmZddlm	Z	ddl
mZdddd	d
ddd
gZej
d�ZeGdd	�d	e��Ze�Ze`ejdd�Zejdd�Zejdddd�Zejdd�ZdS)�N)�Policy�Compat32�compat32�_extend_docstrings)�_has_surrogates)�HeaderRegistry)�raw_data_managerrrr�EmailPolicy�default�strict�SMTP�HTTPz\n|\rcs�eZdZdZdZe�ZeZ�fdd�Z	dd�Z
dd�Zd	d
�Zdd�Z
d
d�Zdd�Zddd�Z�S)r	F�longcs6d|kr"tj|dt��t�j|�dS)N�header_factory)�object�__setattr__r�super�__init__)�self�kw)�	__class__��+/opt/alt/python35/lib64/python3.5/policy.pyrZszEmailPolicy.__init__cCs|j|jS)N)rZ	max_count)r�namerrr�header_max_countaszEmailPolicy.header_max_countcCsU|djdd�\}}|jd�dj|dd��}||jd�fS)Nr�:�z 	�z
)�split�lstrip�join�rstrip)rZsourcelinesr�valuerrr�header_source_parsess	&zEmailPolicy.header_source_parsecCs}t|d�r4|jj�|j�kr4||fSt|t�rgt|j��dkrgtd��||j||�fS)NrrzDHeader values may not contain linefeed or carriage return characters)	�hasattrr�lower�
isinstance�str�len�
splitlines�
ValueErrorr)rrr"rrr�header_store_parse�s

*
'zEmailPolicy.header_store_parsecCs;t|d�r|Sdjtj|��}|j||�S)Nrr)r$r �linesep_splitterrr)rrr"rrr�header_fetch_parse�s	zEmailPolicy.header_fetch_parsecCs|j||dd�S)N�
refold_binaryT)�_fold)rrr"rrr�fold�szEmailPolicy.foldcCsF|j||d|jdk�}|jr0dnd}|j|d�S)Nr.Z7bit�utf8�ascii�surrogateescape)r/Zcte_typer1�encode)rrr"Zfolded�charsetrrr�fold_binary�s!zEmailPolicy.fold_binarycst|d�r|jd|�S|jr1|jn	td��|j�}|jdkp�|jdko�|r�t|d�t|�d�kp�t�fdd	�|d
d�D��}|s�|r�t|�r�|j	|dj
|��jd|�S|d|jj
|�|jS)
NrZpolicy�inf�allrr�c3s!|]}t|��kVqdS)N)r()�.0�x)�maxlenrr�	<genexpr>�sz$EmailPolicy._fold.<locals>.<genexpr>rrz: )r$r0�max_line_length�floatr)�
refold_sourcer(�anyrrr �linesep)rrr"r.�linesZrefoldr)r<rr/�s*)%zEmailPolicy._fold)�__name__�
__module__�__qualname__r1r@rrrZcontent_managerrrr#r+r-r0r6r/rr)rrr	s=	
Zraise_on_defectTrBz
r>r1)�reZemail._policybaserrrrZemail.utilsrZemail.headerregistryrZemail.contentmanagerr�__all__�compiler,r	r
rZclonerrr
ZSMTPUTF8rrrr�<module>s*"	�	

?>