ó CØê[c@sªdZddlZddgZd„Zd„Zd„Zd„Zd „Zd d gd „Zdd „Z gd„Z d„Z d„Z d„Zedkr¦e ƒndS(s%Mailcap file handling. See RFC 1524.iÿÿÿÿNtgetcapst findmatchcCs©i}xœtƒD]‘}yt|dƒ}Wntk r?qnX|t|ƒ}WdQXxE|jƒD]7\}}||kr‹|||R ((s/usr/lib/python2.7/mailcap.pyt§s(RR+tfilter(RR:R R=t MIMEtypes((s/usr/lib/python2.7/mailcap.pyR7žs   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}qóW|||!} |d}|t| |ƒ}q|d|}qW|S( NRiit%s\tsttt{t}(Rt findparam( R/R:R;R<tresR-R.R5R4tname((s/usr/lib/python2.7/mailcap.pyR8ªs6               cCsO|jƒd}t|ƒ}x,|D]$}|| jƒ|kr#||Sq#WdS(NR)R(R!R(RJR<R.tp((s/usr/lib/python2.7/mailcap.pyRHÊs    c Csôddl}tƒ}|jds0t|ƒdSx½tdt|jƒdƒD] }|j||d!}t|ƒdkrdGHdS|d}|d}t||d|ƒ\}}|sÂdGtGHqLdG|GHtj |ƒ}|rLd G|GHqLqLWdS( Niÿÿÿÿiis"usage: mailcap [MIMEtype file] ...iR(sNo viewer found fors Executing:s Exit status:( tsysRtargvtshowRRRttypeRR9( RLRR-targsR:tfileR?R>tsts((s/usr/lib/python2.7/mailcap.pyR6Õs&    "    cCs¿dGHxtƒD]}d|GHqWH|s5tƒ}ndGHH|jƒ}|jƒxg|D]_}|GH||}xG|D]?}|jƒ}|jƒx|D]}d|G||GHq—WHqtWqXWdS(NsMailcap files:s sMailcap entries:s %-15s(RRtkeystsort(RtfntckeysROR=R>RStk((s/usr/lib/python2.7/mailcap.pyRNës&          t__main__(t__doc__Rt__all__RRRRR*RR+R7R8RHR6RNt__name__(((s/usr/lib/python2.7/mailcap.pyts     &