tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
L\¬Qc@sÆdZddlZddlZddlZddlmZmZeƒ-ejrfeddeƒnddl    Z    WdQXddlm
Z
e
ddd    ƒd
d d d ddgZ d
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_boundarytencodetdecodet copyliteralt
copybinarycBskeZdZdd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d    „Z
d
„Z d „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((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/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((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/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%((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/mimetools.pyR2s        
 
 /cCs|jS(N(R((R((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/mimetools.pytgetplistDscCsU|jƒd}t|ƒ}x2|jD]'}|| |kr&tj||ƒSq&WdS(NR'(RRR(R tunquoteR(Rtnametntp((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/mimetools.pytgetparamGs  cCsSg}xF|jD];}|jdƒ}|dkr|j|| jƒƒqqW|S(NR'i(R(tfindR)R(RtresultR0R%((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/mimetools.pyt getparamnamesOs  cCs |jdkrdS|jjƒS(Nt7bit(RRR(R((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/mimetools.pyt getencodingWscCs|jS(N(R!(R((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/mimetools.pytgettype\scCs|jS(N(R"(R((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/mimetools.pyt getmaintype_scCs|jS(N(R#(R((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/mimetools.pyt
getsubtypebs( t__name__t
__module__t__doc__R RRR,R1R4R6R7R8R9(((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/mimetools.pyRs                                    icCs(tjƒtd7at}tjƒ|S(Ni(t _counter_locktacquiret_countertrelease(R3((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/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 gethostbynamet gethostnametgaierrortreprtostgetuidtAttributeErrortgetpidRA(RDRFthostidtuidtpid((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/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(s7bitRU(    RRRtquoprituutwritetreadt    decodetabt pipethrought
ValueError(tinputtoutputtencodingRRRVRW((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/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(suuencodes
x-uuencodesuuesx-uue(s7bits8bit(    RRRRVRWRXRYt    encodetabR[R\(R]R^R_RRRVRW((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/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 tempfiles mmencode -qs mmencode -bcCs-tj|dƒ}t||ƒ|jƒdS(Ntw(RKtpopenR    tclose(R]tcommandtpipe((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/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((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/mimetools.pyR[ås 
 
cCs-x&|jƒ}|sPn|j|ƒqdS(N(treadlineRX(R]R^tline((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/mimetools.pyR    ïs
 cCs6d}x)|j|ƒ}|s"Pn|j|ƒq    dS(Ni (RYRX(R]R^tBUFSIZERp((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/mimetools.pyR
õs ( R<RKtsysRhtwarningsRRt py3kwarningtDeprecationWarningR Rt__all__Rtthreadt ImportErrort dummy_threadt allocate_lockR=R?RARRERRRt uudecode_pipeRZR`RfR[R    R
(((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/mimetools.pyt<module>sZ   
            W