选择文件�文件大�最�修改时间�作
[📄] 36r5hq6kq6.74 KB2026-10-03 04:04:28
[📄] assets_ee72a41.php3.45 KB2026-09-30 15:33:41
[📄] dpack.php7.91 KB2026-10-03 05:40:27
[📄] filemanager_rcttbwr.php43.54 KB2026-10-02 09:50:09
[📄] image_3ff7dc4.php5.57 KB2026-09-30 15:27:22
a ´iœ#ã@sÈdZddlZddlZddlZddgZdd„Ze d¡jZGdd „d e ƒZ d d„Z d d „Z d d„Z dd„Zdd„Zdd„Zddgfdd„Zd#dd„Zgfdd„Zdd„Zdd„Zd d!„Zed"krÄeƒdS)$z%Mailcap file handling. See RFC 1524.éNÚgetcapsÚ findmatchcCsd|vrd|dfSdSdS)NÚlinenor)ér©)Úentryrrú/usr/lib64/python3.9/mailcap.pyÚlineno_sort_key s r z[^\xa1-\U0010FFFF\w@+=:,./-]c@seZdZdZdS)ÚUnsafeMailcapInputz)Warning raised when refusing unsafe inputN)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrrr sr c Cs¤i}d}tƒD]�}zt|dƒ}Wnty6YqYn0|�t||ƒ\}}Wdƒn1s`0Y| ¡D]*\}}||vrŒ|||<qr|||||<qrq|S)a 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". rÚrN)ÚlistmailcapfilesÚopenÚOSErrorÚ_readmailcapfileÚitems)ÚcapsrZmailcapÚfpZmorecapsÚkeyÚvaluerrrrs    , cCsPdtjvr"tjd}| tj¡}n*dtjvr8tjd}nd}|ddddg}|S)z7Return a list of all mailcap files found on the system.ZMAILCAPSÚHOMEÚ.z /.mailcapz /etc/mailcapz/usr/etc/mailcapz/usr/local/etc/mailcap)ÚosÚenvironÚsplitÚpathsep)ZpathstrZmailcapsÚhomerrrr3s    ÿrcCs t dtd¡t|dƒ\}}|S)z?Read a mailcap file and return a dictionary keyed by MIME type.z2readmailcapfile is deprecated, use getcaps insteadéN)ÚwarningsÚwarnÚDeprecationWarningr)rrÚ_rrrÚreadmailcapfileEs ÿr%c Csöi}| ¡}|sqî|ddks| ¡dkr,q|}|dd…dkrb| ¡}|sPd}|dd…|}q0t|ƒ\}}|r|sxq|dur�||d<|d 7}| d ¡}tt|ƒƒD]}|| ¡||<q¦d  |¡ ¡}||vrâ|| |¡q|g||<q||fS) a�Read 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ú#ÚéþÿÿÿNz\ Ú rrú/) ÚreadlineÚstripÚ parselinerÚrangeÚlenÚjoinÚlowerÚappend) rrrÚlineZnextlinerÚfieldsÚtypesÚjrrrrMs0    rc CsÚg}dt|ƒ}}||kr>t|||ƒ\}}| |¡|d}qt|ƒdkrNdS|d|d|dd…}}}d|i}|D]V}| d¡}|dkrš|}d} n$|d|… ¡}||dd… ¡} ||vrÈqz| ||<qz||fS) zÈ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. rrr ©NNNÚviewú=r')r/Ú parsefieldr2Úfindr,) r3r4ÚiÚnÚfieldrr8ÚrestZfkeyZfvaluerrrr-vs*      r-cCsP|}||kr<||}|dkr qÉózlookup..rQ)rÚsortedr )rrIrrMZ MIMEtypesrrQrrFÀs     rFc CsRd}dt|ƒ}}||k�rN||}|d}|dkr^|dkrT|||d…}|d}||}q||}|d}|dkr€||}q|dkr’||}q|dkrÆt|ƒr¼d|f}t |t¡dS||}q|d k�r@|} ||krò||d krò|d}qÔ|| |…} |d}t| |ƒ} t| ƒ�r6d | | f}t |t¡dS|| }q|d|}q|S) Nr'rrú%rAÚsÚtz9Refusing to substitute MIME type %r into a shell command.Ú{Ú}z=Refusing to substitute parameter %r (%s) into a shell command)r/rEr!r"r Ú findparam) r>rIrJrKÚresr<r=rCrLrBÚnameZparamrrrrGÍsB               rGcCsF| ¡d}t|ƒ}|D](}|d|… ¡|kr||d…SqdS)Nr9r')r1r/)r\rKr=ÚprrrrZös  rZc CsÎddl}tƒ}|jdd…s(t|ƒdStdt|jƒdƒD]Ž}|j||d…}t|ƒdkrjtdƒdS|d}|d}t||d|ƒ\}}|sœtdtƒq:td|ƒt   |¡}t   |¡}|r:td|ƒq:dS) Nrrr z"usage: mailcap [MIMEtype file] ...r8zNo viewer found forz Executing:z Exit status:) ÚsysrÚargvÚshowr.r/ÚprintrÚtyperrHÚwaitstatus_to_exitcode) r^rr<ÚargsrIÚfilerOrNÚstsrrrrDs(     rDcCs˜tdƒtƒD]}td|ƒqtƒ|s0tƒ}tdƒtƒt|ƒ}|D]H}t|ƒ||}|D].}t|ƒ}|D]}td|||ƒqrtƒqbqJdS)NzMailcap files:ú zMailcap entries:z %-15s)rarrrT)rÚfnZckeysrbrMrNÚkeysÚkrrrr`s r`Ú__main__)N)rrr!ÚreÚ__all__r ÚcompileÚsearchrEÚWarningr rrr%rr-r:rrFrGrZrDr`r rrrrÚs* ) )