HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python3.5/__pycache__/mailcap.cpython-35.pyc


Fa@sdZddlZddlZddgZddZddZdd	Zd
dZdd
ZddZ	ddZ
ddgddZdddZgddZ
ddZddZddZedkredS) z%Mailcap file handling.  See RFC 1524.Ngetcaps	findmatchcCs"d|krd|dfSdSdS)Nlinenor)rr)entryrr/usr/lib/python3.5/mailcap.pylineno_sort_key	sr	cCsi}d}xtD]}yt|d}Wntk
rFwYnX|t||\}}WdQRXxE|jD]7\}}||kr|||<qw|||||<qwWqW|S)aReturn 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".

    rrN)listmailcapfilesopenOSError_readmailcapfileitems)capsrZmailcapfpZmorecapskeyvaluerrrrs


cCspdtjkr1tjd}|jtj}n;dtjkrPtjd}nd}|ddddg}|S)z7Return a list of all mailcap files found on the system.ZMAILCAPSHOME.z	/.mailcapz/etc/mailcapz/usr/etc/mailcapz/usr/local/etc/mailcap)osenvironsplitpathsep)ZpathstrZmailcapsZhomerrrr-s

rcCs,tjdtdt|d\}}|S)z?Read a mailcap file and return a dictionary keyed by MIME type.z2readmailcapfile is deprecated, use getcaps insteadN)warningswarnDeprecationWarningr)rr_rrrreadmailcapfile?s	
rc	Csai}xN|j}|sP|ddks	|jdkrAq	|}xF|dddkr|j}|sxd}|dd|}qJWt|\}}|o|sq	|dk	r||d<|d	7}|jd
}x.tt|D]}||j||<qWd
j|j}||krF||j|q	|g||<q	W||fS)
aRead 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".
    r#rNz\

rr/r$)	readlinestrip	parselinerrangelenjoinlowerappend)	rrrlineZnextlinerfieldstypesjrrrrGs6	"

rc
Cs1g}dt|}}x?||krZt|||\}}|j||d}qWt|dkrqdS|d|d|dd}}}d|i}x|D]y}|jd}|dkr|}d}	n0|d|j}||ddj}	||krq|	||<qW||fS)	zParse 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.
    rrrNview=r!)NN)r)
parsefieldr,findr&)
r-r.infieldrr1restZfkeyZfvaluerrrr'ps*
&
	r'cCsp|}xM||krU||}|dkr/Pq	|dkrH|d}q	|d}q	W|||j|fS)z/Separate one key-value pair in a mailcap entry.;\rr)r&)r-r5r6startcrrrr3s

r3r1z	/dev/nullc	Cst|||}xn|D]f}d|kr_t|d||}|r_tj|dkr_qt|||||}||fSWdS)aFind 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.

    testrN)NN)lookupsubstrsystem)	rMIMEtyperfilenameplistentrieser=commandrrrrs	
csg}||kr |||}|jd}|dd}||krW|||}dk	r|fdd|D}t|dt}|S)Nr#rz/*cs"g|]}|kr|qSrr).0rE)rrr
<listcomp>s	zlookup.<locals>.<listcomp>r)rsortedr	)rrArrDZ	MIMEtypesr)rrr>sr>c
Cscd}dt|}}xC||kr^||}|d}|dkr|dkrr|||d}|d}||}q||}|d}|dkr||}q|dkr||}q|dkr||}q|dkrM|}x*||kr||d	kr|d}qW|||}	|d}|t|	|}q|d|}qW|S)
Nr!rr%r:st{})r)	findparam)
r7rArBrCZresr5r6r<r;namerrrr?s6









r?cCs[|jd}t|}x8|D]0}|d|j|kr#||dSq#WdS)Nr2r!)r+r))rPrCr6prrrrOs
rOc	Csddl}t}|jdds6t|dSxtdt|jdD]}|j||d}t|dkrtddS|d}|d}t||d|\}}|stdtqRtd|t	j
|}|rRtd|qRWdS)	Nrrrz"usage: mailcap [MIMEtype file] ...r1zNo viewer found forz
Executing:zExit status:)sysrargvshowr(r)printrtyperr@)	rRrr5argsrAfilerFrEstsrrrr=s&	
"



r=cCstdxtD]}td|qWt|sBt}tdtt|}xl|D]d}t|||}xG|D]?}t|}x#|D]}td|||qWtqWqfWdS)NzMailcap files:	zMailcap entries:z  %-15s)rUrrrI)rfnZckeysrVrDrEkeyskrrrrTs"
	





rT__main__)__doc__rr__all__r	rrrrr'r3rr>r?rOr=rT__name__rrrr<module>s$
)