Ñò §ÚêLc@s•dZddkZddkZddkZdddgZdefd„ƒYZddd„Zdddd „Z d „Z e d jo e ƒndS( sƒImplementation of the UUencode and UUdecode functions. encode(in_file, out_file [,name, mode]) decode(in_file [, out_file, mode]) iÿÿÿÿNtErrortencodetdecodecBseZRS((t__name__t __module__(((s/usr/lib64/python2.6/uu.pyR'scCsƒ|djo ti}n„t|tƒos|d jotii|ƒ}n|d jo0yti|ƒi }WqŠt j oqŠXnt |dƒ}n|djo ti }n$t|tƒot |dƒ}n|d jo d}n|d jo d}n|i d|d@|fƒ|idƒ}x=t|ƒdjo)|i ti|ƒƒ|idƒ}q5W|i d ƒd S( s Uuencode filet-trbtwi¶s begin %o %s iÿi-is end N(tsyststdint isinstancet basestringtNonetostpathtbasenametstattst_modetAttributeErrortopentstdouttwritetreadtlentbinasciitb2a_uu(tin_filetout_filetnametmodetdata((s/usr/lib64/python2.6/uu.pyR*s4           ic CsÌ|djo ti}n!t|tƒot|ƒ}nx¬to¤|iƒ}|ptdƒ‚n|idƒpq=n|i ddƒ}t |ƒdjoA|ddjo0yt |dd ƒPWqät j oqäXq=q=W|djo;|diƒ}tii|ƒotd |ƒ‚q1n|djot |dd ƒ}nt}|djo ti}n]t|tƒoLt|d ƒ}ytii||ƒWntj onX|}t}n|iƒ}x¼|o´|iƒd jo¡yti|ƒ} Wnntij o_} t|dƒd d@ddd} ti|| ƒ} |ptiid| ƒq~nX|i| ƒ|iƒ}qàW|ptdƒ‚n|o|iƒndS(sDecode uuencoded fileRs'No valid begin line found in input filetbegint iiiiis"Cannot overwrite existing file: %stwbtendi i?iis Warning: %s sTruncated input fileN(RR R R RtTruetreadlineRt startswithtsplitRtintt ValueErrorR trstripR RtexiststFalseRtchmodRtstripRta2b_uutordtstderrRtclose( RRRtquietthdrt hdrfieldstopenedtfptsRtvtnbytes((s/usr/lib64/python2.6/uu.pyRSsf   $      $ c CsÍddk}|iddƒ}|iddddd d d td d ƒ|iddddd dd td d ƒ|iƒ\}}t|ƒdjo|idƒtidƒnti }ti }t|ƒdjo|d}nt|ƒdjo|d}n|i o_|i oDt |tƒot|dƒ}q]tidGdGHtidƒnt ||ƒn\|i oDt |tƒot|dƒ}q¼tidGdGHtidƒnt||ƒdS(suuencode/uudecode main programiÿÿÿÿNtusages'usage: %prog [-d] [-t] [input [output]]s-ds--decodetdestRthelpsDecode (instead of encode)?tdefaulttactiont store_trues-ts--textttexts2data is text, encoded format unix-compatible text?isincorrect number of argumentsiiRs: cannot do -t to stdouttrs: cannot do -t from stdin(toptparset OptionParsert add_optionR+t parse_argsRterrorRtexitR RRR@R R RtargvR(RBtparsertoptionstargstinputtoutput((s/usr/lib64/python2.6/uu.pyttest”s6 ((      t__main__( t__doc__RR Rt__all__t ExceptionRR RRRNR(((s/usr/lib64/python2.6/uu.pyts   )A %