? GR0V Shell

GR0V shell

Linux in-mum-web921.main-hosting.eu 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64

Path : /lib64/python2.7/
File Upload :
Current File : //lib64/python2.7/mailcap.pyo

ó
zfc@sêdZddlZddlZddlZddgZejdƒjZdefd„ƒYZ	d„Z
d	„Zd
„Zd„Z
d„Zd
dgd„Zdd„Zgd„Zd„Zd„Zd„ZedkræeƒndS(s%Mailcap file handling.  See RFC 1524.iÿÿÿÿNtgetcapst	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scCs©i}xœtƒD]‘}yt|dƒ}Wntk
r?qnX|t|ƒ}WdQXxE|jƒD]7\}}||kr‹|||<qf|||||<qfWqW|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".

    trN(tlistmailcapfilestopentIOErrortreadmailcapfilet	iteritems(tcapstmailcaptfptmorecapstkeytvalue((s/usr/lib64/python2.7/mailcap.pyRs


cCsmdtjkr.tjd}|jdƒ}n;dtjkrMtjd}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/lib64/python2.7/mailcap.pyR+s

cCs;i}x.|jƒ}|sPn|ddks	|jƒdkrGq	n|}x=|ddkrŒ|jƒ}|s{d}n|d |}qPWt|ƒ\}}|o¨|s±q	n|jdƒ}x.tt|ƒƒD]}||jƒ||<qÓWdj|ƒjƒ}||kr&||j|ƒq	|g||<q	W|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tlinetnextlineRtfieldsttypestj((s/usr/lib64/python2.7/mailcap.pyR
>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¥|	||<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)titntfieldRR,tresttfkeytfvalue((s/usr/lib64/python2.7/mailcap.pyR!ds*
 

	cCsm|}xM||krU||}|dkr/Pq	|dkrH|d}q	|d}q	W|||!jƒ|fS(s/Separate one key-value pair in a mailcap entry.t;s\ii(R (R'R1R2tstarttc((s/usr/lib64/python2.7/mailcap.pyR.ƒs

R,s	/dev/nullc
CsÛt|ƒr-d|f}tj|tƒdSt|||ƒ}x•|D]}d|kr¤t|d||ƒ}|dkr€qFn|r¤tj|ƒdkr¤qFq¤nt|||||ƒ}	|	dk	rF|	|fSqFWdS(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.

    sHRefusing to use mailcap with filename %r. Use a safe temporary filename.ttestiN(NN(NN(	t_find_unsafetwarningstwarnRR/tlookuptsubstRtsystem(
RtMIMEtypeRtfilenametplisttmsgtentriesteR:tcommand((s/usr/lib64/python2.7/mailcap.pyR“s 	

	cCs…g}||kr#|||}n|jdƒ}|dd}||kr]|||}n|dk	rt|d„|ƒ}n|S(NRis/*cSs
||kS(N((RFR((s/usr/lib64/python2.7/mailcap.pyt<lambda>·R(RR/tfilter(RRARREt	MIMEtypes((s/usr/lib64/python2.7/mailcap.pyR>®scCsÃd}dt|ƒ}}x£||kr¾||}|d}|dkr|dkrr|||d!}|d}n||}q||}|d}|dkr¬||}q|dkrÅ||}q|dkrt|ƒrþd|f}tj|tƒdS||}q|d	kr­|}	x*||krI||d
krI|d}q W||	|!}
|d}t|
|ƒ}t|ƒr d||
f}tj|tƒdS||}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|jƒd}t|ƒ}x,|D]$}|| jƒ|kr#||Sq#WdS(NR-R(R%R#(RRRCR2tp((s/usr/lib64/python2.7/mailcap.pyRPã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:(
tsysRtargvtshowR"R#RttypeRR@(	RURR1targsRAtfileRGRFtsts((s/usr/lib64/python2.7/mailcap.pyR:î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(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.pyt<module>s&			&		)			

T1KUS90T
  root-grov@89.117.188.241:~$