AlkantarClanX12

Your IP : 3.147.6.176


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

a

R�f�B�@s�gd�ZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddl	mZddl	m
Z
ddl	mZmZmZddlmZdZd	Zd	Zd
ZdZe�d�Ze�d
�Zdd�Zdd�Zd@dd�Zdd�Zdd�ZdZ dd�dd�Z!dd�Z"dd �Z#d!d"�Z$d#d$�Z%dAd&d'�Z&dBd(d)�Z'dCd*d+�Z(d,d-�Z)dd�d.d/�Z*d0d1�Z+d2d3�Z,dDd4d5�Z-e�d6ej.�Z/d7d8�Z0dEd;d<�Z1dFd>d?�Z2dS)G)�collapse_rfc2231_value�
decode_params�decode_rfc2231�encode_rfc2231�
formataddr�
formatdate�format_datetime�getaddresses�
make_msgid�	mktime_tz�	parseaddr�	parsedate�parsedate_tz�parsedate_to_datetime�unquote�N)�quote)�AddressList)r
)rr
�
_parsedate_tz)�Charsetz, �z
�'z[][\\()<>@,:;".]z[\\"]cCs(z|��WdSty"YdS0dS)NFT)�encode�UnicodeEncodeError)�s�r�0/opt/alt/python39/lib64/python3.9/email/utils.py�_has_surrogates4s
rcCs|�dd�}|�dd�S)N�utf-8�surrogateescape�replace)r�decode)�stringZoriginal_bytesrrr�	_sanitizeAsr"rcCs�|\}}|�d�|r�z|�d�Wn:ty^t|t�rDt|�}|�|�}d||fYS0d}t�|�rrd}t�	d|�}d||||fS|S)N�asciiz%s <%s>r�"z\\\g<0>z%s%s%s <%s>)
rr�
isinstance�strrZ
header_encode�
specialsre�search�	escapesre�sub)Zpair�charset�nameZaddressZencoded_nameZquotesrrrrMs 




rccs\d}d}t|�D]8\}}|r0|d|fVd}q|dkr>d}q||fVq|rX|dfVdS)NrF�\T)�	enumerate)�addr�pos�escape�chrrr�_iter_escaped_charsnsr3cCs�d|vr|Sd}d}g}t|�D]D\}}|dkr |dur>|}q ||krX|�|||��|d}d}q |t|�kr�|�||d��d�|�S)Nr$r�r)r3�append�len�join)r/�startZopen_pos�resultr0r2rrr�_strip_quoted_realnames}s r:T)�strictcCs�|s&t�dd�|D��}t|�}|jSdd�|D�}t|�}t�|�}t|�}t|j�}d}|D]}t|�}|d|�d�7}q`t|�|kr�dgS|S)	Ncss|]}t|�VqdS)N�r&��.0�vrrr�	<genexpr>��zgetaddresses.<locals>.<genexpr>cSsg|]}t|��qSrr<r=rrr�
<listcomp>�rAz getaddresses.<locals>.<listcomp>rr4�,�rr)	�
COMMASPACEr7�_AddressList�addresslist�_pre_parse_validation�_post_parse_validationr:�countr6)Zfieldvaluesr;�all�ar/r9�nr?rrrr�s 

rcCsVt|�}d}t|�D]8\}}|dkr.|d7}q|dkr|d8}|dkrdSq|dkS)Nr�(r4�)F)r:r3)r/Zopensr0r2rrr�_check_parenthesis�s
rPcCs(g}|D]}t|�sd}|�|�q|S)Nz('', ''))rPr5)Zemail_header_fields�accepted_valuesr?rrrrH�srHcCs,g}|D]}d|dvrd}|�|�q|S)N�[r4rD)r5)Zparsed_email_header_tuplesrQr?rrrrI�srIc	CsHdgd�|d|dgd�|dd|d|d|d	|d
|fS)Nz"%s, %02d %s %04d %02d:%02d:%02d %s)ZMonZTueZWedZThuZFriZSatZSun��)ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecr4r���r)�	timetuple�zonerrr�_format_timetuple_and_zone�s
��rZFcCsR|durt��}|s|r,tj�|tjj�}ntj�|�}|rH|��}d}t||�S)NF)�time�datetimeZ
fromtimestamp�timezone�utcZutcfromtimestamp�
astimezoner)�timeval�	localtime�usegmt�dtrrrr�srcCsV|��}|r2|jdus$|jtjjkr,td��d}n|jdurBd}n
|�d�}t||�S)Nz%usegmt option requires a UTC datetimeZGMTz-0000z%z)rX�tzinfor\r]r^�
ValueError�strftimerZ)rcrb�nowrYrrrrs

rcCs^tt��d�}t��}t�d�}|dur0d}nd|}|durHt��}d|||||f}|S)N�d�@r�.z<%d.%d.%d%s@%s>)�intr[�os�getpid�randomZgetrandbits�socketZgetfqdn)ZidstringZdomainr`�pidZrandintZmsgidrrrr	"s

r	cCsNt|��^}}|dur(tj|dd��Stj|dd�dt�tj|d��i�S)NrSrd��seconds)rr\r]�	timedelta)�dataZdtuple�tzrrrr9s�rcCsv|st|�j}|sdS|dSt|t�r0|d}t|t�s>dSt|g�d}tt|�j�}|rjt|�dkrndS|dS)NrDrr4)rFrGr%�listr&rHrIr6)r/r;ZaddrsrrrrAs	


rcCs`t|�dkr\|�d�r<|�d�r<|dd��dd��dd�S|�d�r\|�d�r\|dd�S|S)	Nr4r$���z\\r-z\"�<�>)r6�
startswith�endswithrr<rrrr`srcCs&|�td�}t|�dkr"dd|fS|S)NrT)�split�TICKr6)r�partsrrrrls
rcCsDtjj|d|pdd�}|dur*|dur*|S|dur6d}d|||fS)Nrr#)Zsafe�encodingz%s'%s'%s)�urllib�parser)rr+�languagerrrrtsrz&^(?P<name>\w+)\*((?P<num>[0-9]+)\*?)?$c
Cs@|dg}i}|dd�D]x\}}|�d�}t|�}t�|�}|r||�dd�\}}|durbt|�}|�|g��|||f�q|�|dt|�f�q|�r<|�	�D]�\}}g}d}	|�
�|D],\}}
}|r�tjj|
dd	�}
d
}	|�|
�q�tt
�|��}|	�r(t|�\}}}|�|||d|ff�q�|�|d|f�q�|S)Nrr4�*r,�numz"%s"Fzlatin-1)rT)r{r�rfc2231_continuation�match�grouprk�
setdefaultr5r�items�sortr�r��EMPTYSTRINGr7r)
�params�
new_paramsZrfc2231_paramsr,�valueZencodedZmor�Z
continuationsZextendedrr+r�rrrr�s8


rr�us-asciicCslt|t�rt|�dkrt|�S|\}}}|dur4|}t|d�}zt|||�WStyft|�YS0dS)NrUzraw-unicode-escape)r%�tupler6r�bytesr&�LookupError)r��errorsZfallback_charsetr+r��textZrawbytesrrrr�s

rrwc	Cs|durtj�tjj���S|jdur.|��S|��dd�|f}t�|�}t�	|�}z tj
|jd�}t�||j�}Wn~t
y�|tjt�|�dd��}tjo�|jdk}|r�tjntj}|tj
|d�kr�t�|tj|�}n
t�|�}Yn0|j|d�S)NrwrqrSr)rd)r\rgr]r^r_rdrXr[�mktimerars�	tm_gmtoff�tm_zone�AttributeError�gmtime�daylight�tm_isdst�altzone�tznamer)	rcZisdstZtmrrZlocaltmZdeltaruZdstZgmtoffrrrra�s$


ra)r)NFF)F)NN)NN)rr�)Nrw)3�__all__rl�rer[rnror\Zurllib.parser�Zemail._parseaddrrrrFr
rr
rZ
email.charsetrrEr�ZUEMPTYSTRINGZCRLFr}�compiler'r)rr"rr3r:Zsupports_strict_parsingrrPrHrIrZrrr	rrrrr�ASCIIr�rrrarrrr�<module>s\



!,
	



�0�