config root man

Current Path : /compat/linux/proc/self/root/usr/local/lib/python2.5/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //compat/linux/proc/self/root/usr/local/lib/python2.5/mailcap.pyo

³ò
h”Rc@s¬dZddkZddgZd„Zd„Zd„Zd„Zd	„Zd
dgd„Zdd
„Z
gd„Zd„Zd„Z
d„Zedjoe
ƒndS(s%Mailcap file handling.  See RFC 1524.iÿÿÿÿNtgetcapst	findmatchcCsªh}xtƒD]’}yt|dƒ}Wntj
o
qnXt|ƒ}|iƒxG|iƒD]9\}}||jo|||<qe|||||<qeWqW|S(s Return a dictionary containing the mailcap database.

    The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
    to a list of dictionaries corresponding to mailcap entries.  The list
    collects all the entries for that MIME type from all available mailcap
    files.  Each dictionary contains key-value pairs for that MIME type,
    where the viewing command is stored with the key "view".

    tr(tlistmailcapfilestopentIOErrortreadmailcapfiletcloset	iteritems(tcapstmailcaptfptmorecapstkeytvalue((s#/usr/local/lib/python2.5/mailcap.pyR	s




cCsqdtijo tid}|idƒ}n>dtijotid}nd}|ddddg}|S(	s7Return a list of all mailcap files found on the system.tMAILCAPSt:tHOMEt.s	/.mailcaps/etc/mailcaps/usr/etc/mailcaps/usr/local/etc/mailcap(tostenvirontsplit(tstrtmailcapsthome((s#/usr/local/lib/python2.5/mailcap.pyR"s

cCsHh}x;|iƒ}|pPn|ddjp|iƒdjoq	n|}xA|ddjo/|iƒ}|p
d}n|d |}qUWt|ƒ\}}|o|pq	n|idƒ}x.tt|ƒƒD]}||iƒ||<qßWdi|ƒiƒ}||jo||i|ƒq	|g||<q	|S(sRead a mailcap file and return a dictionary keyed by MIME type.

    Each MIME type is mapped to an entry consisting of a list of
    dictionaries; the list will contain more than one such dictionary
    if a given MIME type appears more than once in the mailcap file.
    Each dictionary contains key-value pairs for that MIME type, where
    the viewing command is stored with the key "view".
    it#tiþÿÿÿs\
s
t/(	treadlinetstript	parselineRtrangetlentjointlowertappend(RR	tlinetnextlineR
tfieldsttypestj((s#/usr/local/lib/python2.5/mailcap.pyR5s4	$

c
Cs-g}dt|ƒ}}xA||jo3t|||ƒ\}}|i|ƒ|d}qWt|ƒdjodSn|d|d|d}}}h|d<}xy|D]q}|idƒ}|djo|}d}	n%|| iƒ}||diƒ}	||joq®|	||<q®W||fS(	sÈParse one entry in a mailcap file and return a dictionary.

    The viewing command is stored as the value with the key "view",
    and the rest of the fields produce key-value pairs in the dict.
    iiitviewt=RN(NN(R t
parsefieldR#tNonetfindR(
R$R&titntfieldR
R)tresttfkeytfvalue((s#/usr/local/lib/python2.5/mailcap.pyR[s.

 


cCss|}xS||joE||}|djoPq	|djo|d}q	|d}q	W|||!iƒ|fS(s/Separate one key-value pair in a mailcap entry.t;s\ii(R(R$R.R/tstarttc((s#/usr/local/lib/python2.5/mailcap.pyR+zs



R)s	/dev/nullc	Cs•t|||ƒ}x||D]t}d|jo>t|d||ƒ}|oti|ƒdjoqqjnt|||||ƒ}||fSqWdS(sFind a match for a mailcap entry.

    Return a tuple containing the command line, and the mailcap entry
    used; (None, None) if no match is found.  This may invoke the
    'test' command of several matching entries before deciding which
    entry to use.

    ttestiN(NN(tlookuptsubstRtsystemR,(	R	tMIMEtypeR
tfilenametplisttentriesteR7tcommand((s#/usr/local/lib/python2.5/mailcap.pyRŠs	
cCs‹g}||jo|||}n|idƒ}|dd}||jo|||}n|dj	ot|d„|ƒ}n|S(NRis/*cSs
||jS(((R?R
((s#/usr/local/lib/python2.5/mailcap.pyt<lambda>§s(RR,tfilter(R	R;R
R>t	MIMEtypes((s#/usr/local/lib/python2.5/mailcap.pyR8žs


c
Csqd}dt|ƒ}}xQ||joC||}|d}|djo:|djo|||d!}|d}n||}q||}|d}|djo||}q|djo||}q|djo||}q|djod|}x-||jo||d	jo|d}qÿW|||!}	|d}|t|	|ƒ}q|d|}qW|S(
NRiit%s\tsttt{t}(R t	findparam(
R0R;R<R=tresR.R/R6R5tname((s#/usr/local/lib/python2.5/mailcap.pyR9ªs:












cCsT|iƒd}t|ƒ}x1|D])}|| iƒ|jo||Sq#q#WdS(NR*R(R"R (RKR=R/tp((s#/usr/local/lib/python2.5/mailcap.pyRIÊsc		Csddk}tƒ}|idpt|ƒdSnxÆtdt|iƒdƒD]©}|i||d!}t|ƒdjo
dGHdSn|d}|d}t||d|ƒ\}}|p
dGtGHqQdG|GHti	|ƒ}|o
d	G|GHqQqQWdS(
Niÿÿÿÿiis"usage: mailcap [MIMEtype file] ...iR)sNo viewer found fors
Executing:sExit status:(
tsysRtargvtshowRR RttypeRR:(	RMR	R.targsR;tfileR@R?tsts((s#/usr/local/lib/python2.5/mailcap.pyR7Õs(	



	cCsÁdGHxtƒD]}d|GHqWH|p
tƒ}ndGHH|iƒ}|iƒxg|D]_}|GH||}xG|D]?}|iƒ}|iƒx|D]}d|G||GHq™WHqvWqZWdS(NsMailcap files:s	sMailcap entries:s  %-15s(RRtkeystsort(R	tfntckeysRPR>R?RTtk((s#/usr/local/lib/python2.5/mailcap.pyROës.





t__main__(t__doc__Rt__all__RRRRR+RR,R8R9RIR7ROt__name__(((s#/usr/local/lib/python2.5/mailcap.pys<module>s			&		 			


Man Man