AlkantarClanX12

Your IP : 18.188.96.17


Current Path : /proc/self/root/lib64/python2.7/
Upload File :
Current File : //proc/self/root/lib64/python2.7/mimetools.pyo

�
zfc@s�dZddlZddlZddlZddlmZmZe��-ejrfedde�nddl	Z	WdQXddlm
Z
e
ddd	�d
ddd
ddgZd
e	jfd��YZyddl
Z
Wnek
r�ddlZ
nXe
j�Z[
dad�Zdad�Zd�Zd�ZdZied6ed6ed6ed6dd6dd6Zidd6dd6dd6dd6d d6d!d6Zd"�Zd#�Zd$�Zd%�ZdS(&s<Various tools used by MIME-reading or MIME-writing programs.i����N(tfilterwarningstcatch_warningstignores.*rfc822 has been removed(twarnpy3ks@in 3.x, mimetools has been removed in favor of the email packaget
stacklevelitMessagetchoose_boundarytencodetdecodetcopyliteralt
copybinarycBskeZdZdd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�ZRS(s�A derived class of rfc822.Message that knows about MIME headers and
    contains some hooks for decoding encoded and multipart messages.icCsRtjj|||�|jd�|_|jd�|_|j�|j�dS(Nscontent-transfer-encodingscontent-type(trfc822Rt__init__t	getheadertencodingheadert
typeheadert	parsetypet
parseplist(tselftfptseekable((s!/usr/lib64/python2.7/mimetools.pyRs

cCs�|j}|dkrd}nd|krS|jd�}|||_|| }n	d|_|jd�}x4tt|��D] }||j�j�||<q~Wdj	|�|_
|d|_dj	|d�|_dS(Ns
text/plaint;tt/ii(
RtNonetindext	plisttexttsplittrangetlentstriptlowertjointtypetmaintypetsubtype(Rtstrtitfields((s!/usr/lib64/python2.7/mimetools.pyR!s		

	
cCs�|j}g|_x�|d dkr�|d}d|krM|jd�}nt|�}|| }d|kr�|jd�}|| j�j�d||dj�}n|jj|j��||}qWdS(NiRt=(RtplistRRRRtappend(RR$tendtfR%((s!/usr/lib64/python2.7/mimetools.pyR2s		

/cCs|jS(N(R((R((s!/usr/lib64/python2.7/mimetools.pytgetplistDscCsU|j�d}t|�}x2|jD]'}|| |kr&tj||�Sq&WdS(NR'(RRR(RtunquoteR(Rtnametntp((s!/usr/lib64/python2.7/mimetools.pytgetparamGscCsSg}xF|jD];}|jd�}|dkr|j|| j��qqW|S(NR'i(R(tfindR)R(RtresultR0R%((s!/usr/lib64/python2.7/mimetools.pyt
getparamnamesOscCs |jdkrdS|jj�S(Nt7bit(RRR(R((s!/usr/lib64/python2.7/mimetools.pytgetencodingWscCs|jS(N(R!(R((s!/usr/lib64/python2.7/mimetools.pytgettype\scCs|jS(N(R"(R((s!/usr/lib64/python2.7/mimetools.pytgetmaintype_scCs|jS(N(R#(R((s!/usr/lib64/python2.7/mimetools.pyt
getsubtypebs(
t__name__t
__module__t__doc__RRRR,R1R4R6R7R8R9(((s!/usr/lib64/python2.7/mimetools.pyRs									icCs(tj�td7at}tj�|S(Ni(t
_counter_locktacquiret_countertrelease(R3((s!/usr/lib64/python2.7/mimetools.pyt_get_next_counterss



cCs�ddl}tdkr�ddl}y|j|j��}Wn|jk
rYd}nXyttj	��}Wnt
k
r�d}nXyttj��}Wnt
k
r�d}nX|d|d|andt|j�t�fS(sxReturn a string usable as a multipart boundary.

    The string chosen is unique within a single program run, and
    incorporates the user id (if available), process id (if available),
    and current time.  So it's very unlikely the returned string appears
    in message text, but there's no guarantee.

    The boundary contains dots so you have to quote it in the header.i����Ns	127.0.0.1t1t.s
%s.%.3f.%d(
ttimet_prefixRtsockett
gethostbynametgethostnametgaierrortreprtostgetuidtAttributeErrortgetpidRA(RDRFthostidtuidtpid((s!/usr/lib64/python2.7/mimetools.pyR}s"




cCs�|dkr(ddl}|j||�S|dkrPddl}|j||�S|dkrxddl}|j||�S|d
kr�|j|j��S|tkr�t|t||�n
td|�dS(sDDecode common content-transfer-encodings (base64, quopri, uuencode).tbase64i����Nsquoted-printabletuuencodes
x-uuencodetuuesx-uueR5t8bits%unknown Content-Transfer-Encoding: %s(RSs
x-uuencodeRTsx-uue(R5RU(	RRRtquoprituutwritetreadt	decodetabtpipethrought
ValueError(tinputtoutputtencodingRRRVRW((s!/usr/lib64/python2.7/mimetools.pyR�scCs�|dkr(ddl}|j||�S|dkrSddl}|j||d�S|d
kr{ddl}|j||�S|dkr�|j|j��S|tkr�t|t||�n
td|�dS(sDEncode common content-transfer-encodings (base64, quopri, uuencode).RRi����Nsquoted-printableiRSs
x-uuencodeRTsx-uueR5RUs%unknown Content-Transfer-Encoding: %s(RSs
x-uuencodeRTsx-uue(R5RU(	RRRRVRWRXRYt	encodetabR[R\(R]R^R_RRRVRW((s!/usr/lib64/python2.7/mimetools.pyR�ssa(
TEMP=/tmp/@uu.$$
sed "s%^begin [0-7][0-7]* .*%begin 600 $TEMP%" | uudecode
cat $TEMP
rm $TEMP
)RSs
x-uuencodeRTsx-uuesmmencode -u -qsquoted-printablesmmencode -u -bRRsuuencode tempfilesmmencode -qsmmencode -bcCs-tj|d�}t||�|j�dS(Ntw(RKtpopenR	tclose(R]tcommandtpipe((s!/usr/lib64/python2.7/mimetools.pytpipeto�s
cCs}tj�\}}tj|d�}t||�|j�tj|d|d�}t||�|j�tj|�dS(NRas <tr(	ttempfiletmkstempRKtfdopenR	RcRbR
tunlink(R]RdR^tfdttempnamettempRe((s!/usr/lib64/python2.7/mimetools.pyR[�s



cCs.x'|j�}|sPn|j|�qWdS(N(treadlineRX(R]R^tline((s!/usr/lib64/python2.7/mimetools.pyR	�s
cCs7d}x*|j|�}|s"Pn|j|�q	WdS(Ni (RYRX(R]R^tBUFSIZERp((s!/usr/lib64/python2.7/mimetools.pyR
�s( R<RKtsysRhtwarningsRRtpy3kwarningtDeprecationWarningRRt__all__RtthreadtImportErrortdummy_threadt
allocate_lockR=R?RARRERRRt
uudecode_pipeRZR`RfR[R	R
(((s!/usr/lib64/python2.7/mimetools.pyt<module>sZ
			W