Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib64/python3.7/email/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/email/__pycache__/generator.cpython-37.opt-2.pyc

B

YI~dN�@s�dddgZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZdZd	Z
e�d
�Ze�dej�ZGdd�d�ZGd
d�de�ZdZGdd�de�Zeeejd��ZdeZejZdS)�	Generator�DecodedGenerator�BytesGenerator�N)�deepcopy)�StringIO�BytesIO)�_has_surrogates�_�
z
\r\n|\r|\nz^From c@s�eZdZd&dd�dd�Zdd�Zd'dd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
e
Zdd�Zdd�Zdd�Zd d!�Zed(d"d#��Zed$d%��ZdS))rN)�policycCs6|dkr|dkrdn|j}||_||_||_||_dS)NT)�mangle_from_�_fp�
_mangle_from_�maxheaderlenr)�self�outfprrr�r�4/opt/alt/python37/lib64/python3.7/email/generator.py�__init__$szGenerator.__init__cCs|j�|�dS)N)r
�write)r�srrrrDszGenerator.writeFcCs�|jdkr|jn|j}|dk	r*|j|d�}|jdk	rB|j|jd�}|j|_|�|j�|_d|_|�|j�|_|j}|j}zL||_||_|r�|�	�}|s�dt
�t
�
��}|�||j�|�
|�Wd||_||_XdS)N)�linesep)�max_line_length�zFrom nobody )r�clonerr�_NL�_encode�_encoded_NLZ_EMPTY�_encoded_EMPTYZget_unixfrom�timeZctimer�_write)r�msg�unixfromrrZold_gen_policyZold_msg_policyZufromrrr�flattenHs,
zGenerator.flattencCs|j||jd|jd�S)N)r)�	__class__rr)r�fprrrryszGenerator.clonecCst�S)N)r)rrrr�_new_buffer�szGenerator._new_buffercCs|S)Nr)rrrrrr�szGenerator._encodecCsX|sdSt�|�}x*|dd�D]}|�|�|�|j�q W|drT|�|d�dS)N���)�NLCRE�splitrr)r�lines�linerrr�_write_lines�s

zGenerator._write_linescCs�|j}z"d|_|��|_}|�|�Wd||_|j}|`X|rht|�}|�d|d�|�d|d�t|dd�}|dkr�|�|�n||�|j�|�	��dS)Nzcontent-transfer-encodingrzcontent-type��_write_headers)
r
�
_munge_cter&�	_dispatchrZreplace_header�getattrr.r�getvalue)rr!ZoldfpZsfpZ	munge_cte�methrrrr �s"zGenerator._writecCst|��}|��}t�||f��dd�}t|d|d�}|dkrh|�dd�}t|d|d�}|dkrh|j}||�dS)N�-r	Z_handle_)�get_content_maintype�get_content_subtype�
UNDERSCORE�join�replacer1�
_writeBody)rr!�main�subZspecificr3Zgenericrrrr0�szGenerator._dispatchcCs:x(|��D]\}}|�|j�||��q
W|�|j�dS)N)�	raw_itemsrrZfoldr)rr!�h�vrrrr.�szGenerator._write_headerscCs�|��}|dkrdSt|t�s.tdt|���t|j�r~|�d�}|dk	r~t|�}|d=|�	||�|��}|d|df|_
|jr�t�
d|�}|�|�dS)Nzstring payload expected: %s�charsetzcontent-transfer-encodingzcontent-typez>From )�get_payload�
isinstance�str�	TypeError�typer�_payloadZ	get_paramrZset_payloadr/r�fcrer<r,)rr!�payloadr@rrr�_handle_text�s"


zGenerator._handle_textcCs�g}|��}|dkrg}n(t|t�r2|�|�dSt|t�sB|g}x>|D]6}|��}|�|�}|j|d|jd�|�	|�
��qHW|��}|s�|j�
|�}|�|�}|�|�|jdk	r�|jr�t�d|j�}	n|j}	|�|	�|�|j�|�d||j�|�r|j�|�d��x4|D],}
|�|jd||j�|j�|
��qW|�|jd|d|j�|jdk	�r�|j�r�t�d|j�}n|j}|�|�dS)NF)r"rz>From z--r)rArBrCr�listr&rr#r�appendr2Zget_boundaryrr8�_make_boundaryZset_boundary�preamblerrGr<r,r
�pop�epilogue)rr!ZmsgtextsZsubparts�partr�g�boundaryZalltextrMZ	body_partrOrrr�_handle_multipart�sJ









zGenerator._handle_multipartcCs0|j}|jdd�|_z|�|�Wd||_XdS)Nr)r)rrrS)rr!�prrr�_handle_multipart_signed8s
z"Generator._handle_multipart_signedcCs�g}x�|��D]t}|��}|�|�}|j|d|jd�|��}|�|j�}|rx|d|jkrx|�	|j�
|dd���q|�	|�qW|j�|j�
|��dS)NF)r"rr')
rAr&rr#rr2r)rrrKr8r
r)rr!ZblocksrPrrQ�textr*rrr�_handle_message_delivery_statusCs
z)Generator._handle_message_delivery_statuscCs^|��}|�|�}|j}t|t�rD|j|�d�d|jd�|��}n
|�	|�}|j
�|�dS)NrF)r"r)r&rrFrBrJr#rArr2rr
r)rr!rrQrHrrr�_handle_messageXs




zGenerator._handle_messagecCszt�tj�}dt|d}|dkr(|S|}d}xD|�dt�|�dtj�}|�	|�sZP|dt
|�}|d7}q2W|S)Nz===============z==rz^--z(--)?$�.r-)�randomZ	randrange�sys�maxsize�_fmt�_compile_re�re�escape�	MULTILINE�searchrC)�clsrV�tokenrR�bZcounterZcrerrrrLqs
zGenerator._make_boundarycCst�||�S)N)r_�compile)rcr�flagsrrrr^�szGenerator._compile_re)NN)FN)N)�__name__�
__module__�__qualname__rrr#rr&rr,r r0r.rIr:rSrUrWrX�classmethodrLr^rrrrrs(

1#
:csLeZdZdd�Zdd�Zdd�Zdd�Z�fd	d
�ZeZe	dd��Z
�ZS)
rcCs|j�|�dd��dS)N�ascii�surrogateescape)r
r�encode)rrrrrr�szBytesGenerator.writecCst�S)N)r)rrrrr&�szBytesGenerator._new_buffercCs
|�d�S)Nrl)rn)rrrrrr�szBytesGenerator._encodecCs<x*|��D]\}}|j�|j�||��q
W|�|j�dS)N)r=r
rrZfold_binaryr)rr!r>r?rrrr.�szBytesGenerator._write_headerscs\|jdkrdSt|j�rH|jjdksH|jr:t�d|j�|_|�|j�ntt	|��
|�dS)NZ7bitz>From )rFrrZcte_typerrGr<r,�superrrI)rr!)r$rrrI�s
zBytesGenerator._handle_textcCst�|�d�|�S)Nrl)r_rfrn)rcrrgrrrr^�szBytesGenerator._compile_re)rhrirjrr&rr.rIr:rkr^�
__classcell__rr)r$rr�s

zD[Non-text (%(type)s) part of message omitted, filename %(filename)s]c@s$eZdZddd�dd�Zdd�ZdS)rN)rcCs.tj|||||d�|dkr$t|_n||_dS)N)r)rr�_FMTr])rrrrZfmtrrrrr�s
zDecodedGenerator.__init__cCs�x�|��D]v}|��}|dkr4t|jdd�|d�q
|dkr>q
t|j|��|��|��|�d�|�dd�|�d	d
�d�|d�q
WdS)NrVF)�decode)�fileZ	multipartz
[no filename]zContent-Descriptionz[no description]zContent-Transfer-Encodingz
[no encoding])rE�maintypeZsubtype�filename�description�encoding)	�walkr5�printrAr]Zget_content_typer6�get_filename�get)rr!rPrtrrrr0�s 
zDecodedGenerator._dispatch)NNN)rhrirjrr0rrrrr�sr-z%%0%dd)�__all__r_r[rrZ�copyr�iorrZemail.utilsrr7�NLrfr(rarGrrrqr�len�reprr\�_widthr]rLrrrr�<module>s(

p3;

Hacked By AnonymousFox1.0, Coded By AnonymousFox