usr/lib64/python2.7/mailcap.pyo000064400000017423147204465240012223 0ustar00 zfc@sdZddlZddlZddlZddgZejdjZdefdYZ dZ d Z d Z d Z d Zd dgdZddZgdZdZdZdZedkrendS(s%Mailcap file handling. See RFC 1524.iNtgetcapst findmatchs[^\xa1-\xff\w@+=:,./-]tUnsafeMailcapInputcBseZdZRS(s)Warning raised when refusing unsafe input(t__name__t __module__t__doc__(((s/usr/lib64/python2.7/mailcap.pyR scCsi}xtD]}yt|d}Wntk r?qnX|t|}WdQXxE|jD]7\}}||kr|||s0  "    c Cs g}dt|}}x?||krZt|||\}}|j||d}qWt|dkrqdS|d|d|d}}}i|d6}xu|D]m}|jd}|dkr|}d} n$|| j}||dj} ||krq| ||R(RR/tfilter(R RARREt MIMEtypes((s/usr/lib64/python2.7/mailcap.pyR>s   c Csd}dt|}}x||kr||}|d}|dkr|dkrr|||d!}|d}n||}q||}|d}|dkr||}q|dkr||}q|dkr t|rd|f}tj|tdS||}q|d kr|} x*||krI||d krI|d}q W|| |!} |d}t| |} t| rd | | f}tj|tdS|| }q|d|}qW|S( NRiit%s\tstts9Refusing to substitute MIME type %r into a shell command.t{t}s=Refusing to substitute parameter %r (%s) into a shell command(R#R;R<R=RR/t findparam( R3RARBRCtresR1R2R9RDR8tnametparam((s/usr/lib64/python2.7/mailcap.pyR?sH                   cCsO|jd}t|}x,|D]$}|| j|kr#||Sq#WdS(NR-R(R%R#(RRRCR2tp((s/usr/lib64/python2.7/mailcap.pyRPs    c Csddl}t}|jds0t|dSxtdt|jdD]}|j||d!}t|dkrdGHdS|d}|d}t||d|\}}|sdGtGHqLdG|GHtj |}|rLd G|GHqLqLWdS( Niiis"usage: mailcap [MIMEtype file] ...iR,sNo viewer found fors Executing:s Exit status:( tsysRtargvtshowR"R#RttypeRR@( RUR R1targsRAtfileRGRFtsts((s/usr/lib64/python2.7/mailcap.pyR:s&    "    cCsdGHxtD]}d|GHqWH|s5t}ndGHH|j}|jxg|D]_}|GH||}xG|D]?}|j}|jx|D]}d|G||GHqWHqtWqXWdS(NsMailcap files:s sMailcap entries:s %-15s(RRtkeystsort(R tfntckeysRXRERFR\tk((s/usr/lib64/python2.7/mailcap.pyRWs&          t__main__(RRR<tret__all__tcompiletsearchR;tWarningRRRR R!R.RR/R>R?RPR:RWR(((s/usr/lib64/python2.7/mailcap.pyts&       &   )