³ò ¢l‡Jc @srdZddkZddkZddkZddddddgZdeifd „ƒYZyddkZWnej oddkZnXei ƒZ [d a d „Z dad „Zd „Zd„ZdZhed<ed<ed<ed<dd<dds  cCsUg}xH|iD]=}|idƒ}|djo|i|| iƒƒqqW|S(NR"i(R#tfindR$R(R tresultR+R ((s/sys/lib/python/mimetools.pyt getparamnamesFs  cCs%|idjodSn|iiƒS(Nt7bit(R RR(R ((s/sys/lib/python/mimetools.pyt getencodingNscCs|iS(N(R(R ((s/sys/lib/python/mimetools.pytgettypeSscCs|iS(N(R(R ((s/sys/lib/python/mimetools.pyt getmaintypeVscCs|iS(N(R(R ((s/sys/lib/python/mimetools.pyt getsubtypeYs( t__name__t __module__t__doc__RR R R'R,R/R1R2R3R4(((s/sys/lib/python/mimetools.pyR s        icCs(tiƒtd7at}tiƒ|S(Ni(t _counter_locktacquiret_countertrelease(R.((s/sys/lib/python/mimetools.pyt_get_next_counterjs    cCsõddk}tdjoÂddk}y|i|iƒƒ}Wn|ij o d}nXytti ƒƒ}Wnt j o d}nXytti ƒƒ}Wnt j o d}nX|d|d|andt|iƒ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 gethostnametgaierrortreprtostgetuidtAttributeErrortgetpidR<(R?RAthostidtuidtpid((s/sys/lib/python/mimetools.pyRts"      cCsá|djo ddk}|i||ƒSn|djo ddk}|i||ƒSn|d jo ddk}|i||ƒSn|d jo|i|iƒƒSn|tjot|t||ƒntd |‚dS(sDDecode common content-transfer-encodings (base64, quopri, uuencode).tbase64iÿÿÿÿNsquoted-printabletuuencodes x-uuencodetuuesx-uueR0t8bits%unknown Content-Transfer-Encoding: %s(RNs x-uuencodeROsx-uue(s7bitRP( RMRtquoprituutwritetreadt decodetabt pipethrought ValueError(tinputtoutputtencodingRMRQRR((s/sys/lib/python/mimetools.pyR”s        cCsä|djo ddk}|i||ƒSn|djo#ddk}|i||dƒSn|d jo ddk}|i||ƒSn|djo|i|iƒƒSn|tjot|t||ƒntd |‚dS(sDEncode common content-transfer-encodings (base64, quopri, uuencode).RMiÿÿÿÿNsquoted-printableiRNs x-uuencodeROsx-uueR0RPs%unknown Content-Transfer-Encoding: %s(suuencodes x-uuencodesuuesx-uue(s7bits8bit( RMRRQRRRSRTt encodetabRVRW(RXRYRZRMRQRR((s/sys/lib/python/mimetools.pyR§s        sa( TEMP=/tmp/@uu.$$ sed "s%^begin [0-7][0-7]* .*%begin 600 $TEMP%" | uudecode cat $TEMP rm $TEMP )RNs x-uuencodeROsx-uuesmmencode -u -qsquoted-printablesmmencode -u -bRMsuuencode tempfiles mmencode -qs mmencode -bcCs-ti|dƒ}t||ƒ|iƒdS(Ntw(RFtpopenRtclose(RXtcommandtpipe((s/sys/lib/python/mimetools.pytpipeto×s cCs}tiƒ\}}ti|dƒ}t||ƒ|iƒti|d|dƒ}t||ƒ|iƒti|ƒdS(NR\s sJ    W