eaiovnaovbqoebvqoeavibavo  V~gc@sdZddlZddgZdZdZdZdZd Zd d gd Zdd Z gdZ dZ dZ dZedkre ndS(s%Mailcap file handling. See RFC 1524.iNtgetcapst findmatchcCsi}xtD]}yt|d}Wntk r?qnX|t|}WdQXxE|jD]7\}}||kr|||R ((s,/opt/alt/python27/lib64/python2.7/mailcap.pytR(RR+tfilter(RR:R R=t MIMEtypes((s,/opt/alt/python27/lib64/python2.7/mailcap.pyR7s   c Cs`d}dt|}}x@||kr[||}|d}|dkr|dkrr|||d!}|d}n||}q||}|d}|dkr||}q|dkr||}q|dkr||}q|dkrJ|}x*||kr||d kr|d}qW|||!} |d}|t| |}q|d|}qW|S( NRiit%s\tsttt{t}(Rt findparam( R/R:R;R<tresR-R.R5R4tname((s,/opt/alt/python27/lib64/python2.7/mailcap.pyR8s6               cCsO|jd}t|}x,|D]$}|| j|kr#||Sq#WdS(NR)R(R!R(RJR<R.tp((s,/opt/alt/python27/lib64/python2.7/mailcap.pyRHs    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:( tsysRtargvtshowRRRttypeRR9( RLRR-targsR:tfileR?R>tsts((s,/opt/alt/python27/lib64/python2.7/mailcap.pyR6s&    "    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(RtfntckeysROR=R>RStk((s,/opt/alt/python27/lib64/python2.7/mailcap.pyRNs&          t__main__(t__doc__Rt__all__RRRRR*RR+R7R8RHR6RNt__name__(((s,/opt/alt/python27/lib64/python2.7/mailcap.pyts     &