AlkantarClanX12

Your IP : 3.135.205.231


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

o

6��f1C�@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,dCd4d5�Z-e�d6ej.�Z/d7d8�Z0	9	:dDd;d<�Z1dEd>d?�Z2dS)F)�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|��WdStyYdSw)NFT)�encode�UnicodeEncodeError)�s�r�2/opt/alt/python310/lib64/python3.10/email/utils.py�_has_surrogates4s�rcCs|�dd�}|�dd�S)N�utf-8�surrogateescape�replace)r�decode)�stringZoriginal_bytesrrr�	_sanitizeAsr"rcCs�	|\}}|�d�|rHz|�d�Wnty0t|t�r#t|�}|�|�}d||fYSwd}t�|�r:d}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$


�
rccsb�d}d}t|�D]\}}|r|d|fVd}q	|dkr d}q	||fVq	|r/|dfVdSdS)NrF�\T)�	enumerate)�addr�pos�escape�chrrr�_iter_escaped_charsns��r3cCs�	d|vr|Sd}d}g}t|�D]"\}}|dkr3|dur |}q||kr-|�|||��|d}d}q|t|�krC|�||d��d�|�S)Nr$r�r)r3�append�len�join)r/�startZopen_pos�resultr0r2rrr�_strip_quoted_realnames}s$�
r:T)�strictcCs�	|st�dd�|D��}t|�}|jSdd�|D�}t|�}t�|�}t|�}t|j�}d}|D]}t|�}|d|�d�7}q1t|�|krJdgS|S)	Ncss�|]}t|�VqdS)N�r&��.0�vrrr�	<genexpr>�s�zgetaddresses.<locals>.<genexpr>cSsg|]}t|��qSrr<r=rrr�
<listcomp>�sz 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]\}}|dkr|d7}q
|dkr&|d8}|dkr&dSq
|dkS)Nr�(r4�)F)r:r3)r/Zopensr0r2rrr�_check_parenthesis�s
�rOcCs(g}|D]
}t|�sd}|�|�q|S)Nz('', ''))rOr5)Zemail_header_fields�accepted_valuesr?rrrrG�srGcCs,g}|D]}d|dvrd}|�|�q|S)N�[r4rC)r5)Zparsed_email_header_tuplesrPr?rrrrH�srHc	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
��rYFcCsT	|dur	t��}|s
|rtj�|tjj�}ntj�|�}|r%|��}d}t||�S)NF)�time�datetimeZ
fromtimestamp�timezone�utcZutcfromtimestamp�
astimezoner)�timeval�	localtime�usegmt�dtrrrr�s
rcCsX	|��}|r|jdus|jtjjkrtd��d}n
|jdur"d}n|�d�}t||�S)Nz%usegmt option requires a UTC datetimeZGMTz-0000z%z)rW�tzinfor[r\r]�
ValueError�strftimerY)rbra�nowrXrrrrs


rcCs`	tt��d�}t��}t�d�}|durd}nd|}|dur%t��}d|||||f}|S)N�d�@r�.z<%d.%d.%d%s@%s>)�intrZ�os�getpid�randomZgetrandbits�socketZgetfqdn)ZidstringZdomainr_�pidZrandintZmsgidrrrr	"s	
r	cCsjt|�}|durtdt|���|�^}}|dur"tj|dd��Stj|dd�dt�tj|d��i�S)Nz!Invalid date value or format "%s"rRrc��seconds)rrdr&r[r\�	timedelta)�dataZparsed_date_tzZdtuple�tzrrrr9s
�rcCsx	|st|�j}|sdS|dSt|t�r|d}t|t�s dSt|g�d}tt|�j�}|r6t|�dkr8dS|dS)NrCrr4)rErFr%�listr&rGrHr6)r/r;ZaddrsrrrrDs


rcCsb	t|�dkr/|�d�r|�d�r|dd��dd��dd�S|�d�r/|�d�r/|dd�S|S)	Nr4r$���z\\r-z\"�<�>)r6�
startswith�endswithrr<rrrrcsrcCs(	|�td�}t|�dkrdd|fS|S)NrS)�split�TICKr6)r�partsrrrros

rcCsF	tjj|d|p	dd�}|dur|dur|S|durd}d|||fS)Nrr#)Zsafe�encodingz%s'%s'%s)�urllib�parser)rr+�languagerrrrwsrz&^(?P<name>\w+)\*((?P<num>[0-9]+)\*?)?$c
Cs>	|dg}i}|dd�D]<\}}|�d�}t|�}t�|�}|r?|�dd�\}}|dur2t|�}|�|g��|||f�q|�|dt|�f�q|r�|�	�D]K\}}g}d}	|�
�|D]\}}
}|rptjj|
dd	�}
d
}	|�|
�q_tt
�|��}|	r�t|�\}}}|�|||d|ff�qQ|�|d|f�qQ|S)Nrr4�*r,�numz"%s"Fzlatin-1)r~T)rzr�rfc2231_continuation�match�grouprj�
setdefaultr5r�items�sortrr��EMPTYSTRINGr7r)
�paramsZ
new_paramsZrfc2231_paramsr,�valueZencodedZmor�Z
continuationsZextendedrr+r�rrrr�s:


rr�us-asciicCsht|t�rt|�dkrt|�S|\}}}|dur|}t|d�}zt|||�WSty3t|�YSw)NrTzraw-unicode-escape)r%�tupler6r�bytesr&�LookupError)r��errorsZfallback_charsetr+r��textZrawbytesrrrr�s

�rrvc	Cs	|durtj�tjj���S|jdur|��S|��dd�|f}t�|�}t�	|�}ztj
|jd�}t�||j�}Wn?t
y||tjt�|�dd��}tjoY|jdk}|r_tjntj}|tj
|d�krut�|tj|�}nt�|�}Ynw|j|d�S)NrvrprRr)rc)r[rfr\r]r^rcrWrZ�mktimer`rr�	tm_gmtoff�tm_zone�AttributeError�gmtime�daylight�tm_isdst�altzone�tznamer)	rbZisdstZtmrqZlocaltmZdeltartZdstZgmtoffrrrr`�s*




��
r`)r)NFF)F)NN)rr�)Nrv)3�__all__rk�rerZrmrnr[Zurllib.parserZemail._parseaddrrrrEr
rr
rZ
email.charsetrrDr�ZUEMPTYSTRINGZCRLFr|�compiler'r)rr"rr3r:Zsupports_strict_parsingrrOrGrHrYrrr	rrrrr�ASCIIr�rrr`rrrr�<module>s`


!,

	


�0
�