%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/mimetools.pyc

ó
Mêáac@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/local/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((s%/usr/local/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%((s%/usr/local/lib/python2.7/mimetools.pyR2s		

/cCs|jS(N(R((R((s%/usr/local/lib/python2.7/mimetools.pytgetplistDscCsU|jƒd}t|ƒ}x2|jD]'}|| |kr&tj||ƒSq&WdS(NR'(RRR(RtunquoteR(Rtnametntp((s%/usr/local/lib/python2.7/mimetools.pytgetparamGscCsSg}xF|jD];}|jdƒ}|dkr|j|| jƒƒqqW|S(NR'i(R(tfindR)R(RtresultR0R%((s%/usr/local/lib/python2.7/mimetools.pyt
getparamnamesOscCs |jdkrdS|jjƒS(Nt7bit(RRR(R((s%/usr/local/lib/python2.7/mimetools.pytgetencodingWscCs|jS(N(R!(R((s%/usr/local/lib/python2.7/mimetools.pytgettype\scCs|jS(N(R"(R((s%/usr/local/lib/python2.7/mimetools.pytgetmaintype_scCs|jS(N(R#(R((s%/usr/local/lib/python2.7/mimetools.pyt
getsubtypebs(
t__name__t
__module__t__doc__RRRR,R1R4R6R7R8R9(((s%/usr/local/lib/python2.7/mimetools.pyRs									icCs(tjƒtd7at}tjƒ|S(Ni(t
_counter_locktacquiret_countertrelease(R3((s%/usr/local/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
gethostbynametgethostnametgaierrortreprtostgetuidtAttributeErrortgetpidRA(RDRFthostidtuidtpid((s%/usr/local/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(R5RU(	RRRtquoprituutwritetreadt	decodetabtpipethrought
ValueError(tinputtoutputtencodingRRRVRW((s%/usr/local/lib/python2.7/mimetools.pyRs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/local/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 tempfilesmmencode -qsmmencode -bcCs-tj|dƒ}t||ƒ|jƒdS(Ntw(RKtpopenR	tclose(R]tcommandtpipe((s%/usr/local/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((s%/usr/local/lib/python2.7/mimetools.pyR[ås



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

		
	

Zerion Mini Shell 1.0