Files
PowerToys/PythonHome/Lib/mimetools.pyc

64 lines
8.6 KiB
Plaintext
Raw Normal View History

2014-07-09 18:15:23 +08:00
<03>
<EFBFBD>W`Sc@s<>dZddlZddlZddlZddlmZmZe<00><00>-ejrfedde<00>nddl Z WdQXddlm
Z
e
ddd <00>d
d d d ddgZ d
e j fd<00><00>YZ yddl Z Wnek
r<>ddlZ nXe j<00>Z[ dad<00>Zdad<00>Zd<00>Zd<00>ZdZied6ed6ed6ed6dd6dd6Zidd6dd6dd6dd6d d6d!d6Zd"<00>Zd#<00>Zd$<00>Zd%<00>ZdS(&s<Various tools used by MIME-reading or MIME-writing programs.i<><69><EFBFBD><EFBFBD>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<00>Zd<00>Zd<00>Zd<00>Zd<00>Zd<00>Zd<00>Z d <00>Z
d
<00>Z d <00>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|||<00>|jd<00>|_|jd<00>|_|j<00>|j<00>dS(Nscontent-transfer-encodings content-type(trfc822Rt__init__t getheadertencodingheadert
typeheadert parsetypet
2014-07-10 23:57:08 +08:00
parseplist(tselftfptseekable((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pyR s
2014-07-09 18:15:23 +08:00

cCs<>|j}|dkrd}nd|krS|jd<00>}|||_|| }n d|_|jd<00>}x4tt|<00><00>D] }||j<00>j<00>||<q~Wdj |<00>|_
|d|_ dj |d<1F>|_ dS(Ns
2014-07-10 23:57:08 +08:00
text/plaint;tt/ii( RtNonetindext plisttexttsplittrangetlentstriptlowertjointtypetmaintypetsubtype(Rtstrtitfields((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pyR!s        cCs<>|j}g|_x<>|d dkr<>|d}d|krM|jd<00>}n t|<00>}|| }d|kr<>|jd<00>}|| j<00>j<00>d||dj<00>}n|jj|j<00><00>||}qWdS(NiRt=(RtplistRRRRtappend(RR$tendtfR%((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pyR2s  
2014-07-09 18:15:23 +08:00
  
2014-07-10 23:57:08 +08:00
 /cCs|jS(N(R((R((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pytgetplistDscCsU|j<00>d}t|<00>}x2|jD]'}|| |kr&tj||<1F>Sq&WdS(NR'(RRR(R tunquoteR(Rtnametntp((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pytgetparamGs  cCsSg}xF|jD];}|jd<00>}|dkr|j|| j<00><00>qqW|S(NR'i(R(tfindR)R(RtresultR0R%((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pyt getparamnamesOs  cCs |jdkrdS|jj<00>S(Nt7bit(RRR(R((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pyt getencodingWscCs|jS(N(R!(R((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pytgettype\scCs|jS(N(R"(R((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pyt getmaintype_scCs|jS(N(R#(R((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pyt
2014-07-09 18:15:23 +08:00
getsubtypebs( t__name__t
2014-07-10 23:57:08 +08:00
__module__t__doc__R RRR,R1R4R6R7R8R9(((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pyRs        icCs(tj<00>td7at}tj<00>|S(Ni(t _counter_locktacquiret_countertrelease(R3((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pyt_get_next_counterss
2014-07-09 18:15:23 +08:00



cCs<>ddl}tdkr<>ddl}y|j|j<00><00>}Wn|jk
rYd}nXyttj <00><00>}Wnt
k
r<>d}nXyttj <00><00>}Wnt
k
r<>d}nX|d|d|andt|j<00>t <00>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<><69><EFBFBD><EFBFBD>Ns 127.0.0.1t1t.s
2014-07-10 23:57:08 +08:00
%s.%.3f.%d( ttimet_prefixRtsockett gethostbynamet gethostnametgaierrortreprtostgetuidtAttributeErrortgetpidRA(RDRFthostidtuidtpid((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pyR}s"   
2014-07-09 18:15:23 +08:00
 
 
cCs<>|dkr(ddl}|j||<00>S|dkrPddl}|j||<00>S|d krxddl}|j||<00>S|d kr<>|j|j<00><00>S|tkr<>t|t||<00>n td |<16>dS(sDDecode common content-transfer-encodings (base64, quopri, uuencode).tbase64i<34><69><EFBFBD><EFBFBD>Nsquoted-printabletuuencodes
x-uuencodetuuesx-uueR5t8bits%unknown Content-Transfer-Encoding: %s(RSs
x-uuencodeRTsx-uue(s7bitRU( RRRtquoprituutwritetreadt decodetabt pipethrought
2014-07-10 23:57:08 +08:00
ValueError(tinputtoutputtencodingRRRVRW((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pyR<00>s        cCs<>|dkr(ddl}|j||<00>S|dkrSddl}|j||d<00>S|d kr{ddl}|j||<00>S|dkr<>|j|j<00><00>S|tkr<>t|t||<00>n td |<16>dS(sDEncode common content-transfer-encodings (base64, quopri, uuencode).RRi<><69><EFBFBD><EFBFBD>Nsquoted-printableiRSs
2014-07-09 18:15:23 +08:00
x-uuencodeRTsx-uueR5RUs%unknown Content-Transfer-Encoding: %s(suuencodes
2014-07-10 23:57:08 +08:00
x-uuencodesuuesx-uue(s7bits8bit( RRRRVRWRXRYt encodetabR[R\(R]R^R_RRRVRW((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pyR<00>s        sa(
2014-07-09 18:15:23 +08:00
TEMP=/tmp/@uu.$$
sed "s%^begin [0-7][0-7]* .*%begin 600 $TEMP%" | uudecode
cat $TEMP
rm $TEMP
)RSs
2014-07-10 23:57:08 +08:00
x-uuencodeRTsx-uuesmmencode -u -qsquoted-printablesmmencode -u -bRRsuuencode tempfiles mmencode -qs mmencode -bcCs-tj|d<00>}t||<00>|j<00>dS(Ntw(RKtpopenR tclose(R]tcommandtpipe((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pytpipeto<74>s cCs}tj<00>\}}tj|d<00>}t||<00>|j<00>tj|d|d<00>}t||<00>|j<00>tj|<00>dS(NRas <tr( ttempfiletmkstempRKtfdopenR RcRbR
tunlink(R]RdR^tfdttempnamettempRe((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pyR[<00>s 
2014-07-09 18:15:23 +08:00
 
2014-07-10 23:57:08 +08:00
cCs-x&|j<00>}|sPn|j|<00>qdS(N(treadlineRX(R]R^tline((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pyR <00>s
 cCs6d}x)|j|<00>}|s"Pn|j|<00>q dS(Ni (RYRX(R]R^tBUFSIZERp((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pyR
2014-07-09 18:15:23 +08:00
<00>s ( R<RKtsysRhtwarningsRRt py3kwarningtDeprecationWarningR Rt__all__Rtthreadt ImportErrort dummy_threadt allocate_lockR=R?RARRERRRt uudecode_pipeRZR`RfR[R R
2014-07-10 23:57:08 +08:00
(((s>e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\mimetools.pyt<module>sZ   
2014-07-09 18:15:23 +08:00
   W