AlkantarClanX12

Your IP : 3.147.68.201


Current Path : /opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/__pycache__/mailcap.cpython-37.opt-2.pyc

B

YI~dk#�@s�ddlZddlZddlZddgZdd�Ze�d�jZGdd�de�Z	d	d�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zddgfdd�Zd"dd�Zgfdd�Zdd�Zdd�Zdd �Zed!kr�e�dS)#�N�getcaps�	findmatchcCsd|krd|dfSdSdS)N�linenor)�r�)�entryrr�,/opt/alt/python37/lib64/python3.7/mailcap.py�lineno_sort_key
sr	z[^\xa1-\U0010FFFF\w@+=:,./-]c@seZdZdS)�UnsafeMailcapInputN)�__name__�
__module__�__qualname__rrrrr
sr
c
Cs�i}d}x�t�D]�}yt|d�}Wntk
r8wYnX|�t||�\}}WdQRXx6|��D]*\}}||kr||||<qb|||||<qbWqW|S)Nr�r)�listmailcapfiles�open�OSError�_readmailcapfile�items)�capsrZmailcap�fpZmorecaps�key�valuerrrrs

cCsPdtjkr"tjd}|�tj�}n*dtjkr8tjd}nd}|ddddg}|S)NZMAILCAPS�HOME�.z	/.mailcapz/etc/mailcapz/usr/etc/mailcapz/usr/local/etc/mailcap)�os�environ�split�pathsep)ZpathstrZmailcaps�homerrrr3s


rcCs t�dtd�t|d�\}}|S)Nz2readmailcapfile is deprecated, use getcaps instead�)�warnings�warn�DeprecationWarningr)rr�_rrr�readmailcapfileEsr$c	Csi}x�|��}|sP|ddks|��dkr.q|}x4|dd�dkrf|��}|sTd}|dd�|}q4Wt|�\}}|r|s~q|dk	r�||d<|d7}|�d	�}x$tt|��D]}||��||<q�Wd	�|���}||kr�||�|�q|g||<qW||fS)
Nr�#����z\
�
rr�/)	�readline�strip�	parseliner�range�len�join�lower�append)	rrr�lineZnextliner�fields�types�jrrrrMs6	
rc
Cs�g}dt|�}}x.||kr@t|||�\}}|�|�|d}qWt|�dkrRdS|d|d|dd�}}}d|i}x^|D]V}|�d�}|dkr�|}d}	n$|d|���}||dd���}	||kr�q�|	||<q�W||fS)Nrrr)NN�view�=r&)r.�
parsefieldr1�findr+)
r2r3�i�n�fieldrr6�restZfkeyZfvaluerrrr,vs*

 

r,cCsT|}x:||kr>||}|dkr"Pq|dkr4|d}q|d}qW|||���|fS)N�;�\rr)r+)r2r:r;�start�crrrr8�s

r8r6z	/dev/nullc
Cs�t|�r"d|f}t�|t�dSt|||�}xd|D]\}d|krnt|d||�}|dkrZq4|rnt�|�dkrnq4t|||||�}	|	dk	r4|	|fSq4WdS)NzHRefusing to use mailcap with filename %r. Use a safe temporary filename.)NN�testr)�_find_unsafer r!r
�lookup�substr�system)
r�MIMEtyper�filename�plist�msg�entries�erB�commandrrrr�s 	

cslg}||kr|||}|�d�}|dd}||krB|||}�dk	r\�fdd�|D�}t|td�}|S)Nr)rz/*csg|]}�|kr|�qSrr)�.0rL)rrr�
<listcomp>�szlookup.<locals>.<listcomp>)r)r�sortedr	)rrGrrKZ	MIMEtypesr)rrrD�s
rDcCs\d}dt|�}}�xB||k�rV||}|d}|dkrb|dkrX|||d�}|d}||}q||}|d}|dkr�||}q|dkr�||}q|dkr�t|�r�d|f}t�|t�dS||}q|d	k�rH|}	x ||kr�||d
kr�|d}q�W||	|�}
|d}t|
|�}t|��r>d||
f}t�|t�dS||}q|d|}qW|S)Nr&rr�%r?�s�tz9Refusing to substitute MIME type %r into a shell command.�{�}z=Refusing to substitute parameter %r (%s) into a shell command)r.rCr r!r
�	findparam)r<rGrHrIZresr:r;rArJr@�nameZparamrrrrE�sH








rEcCsF|��d}t|�}x,|D]$}|d|���|kr||d�SqWdS)Nr7r&)r0r.)rWrIr;�prrrrV�s
rVc	Cs�ddl}t�}|jdd�s(t|�dSx�tdt|j�d�D]�}|j||d�}t|�dkrjtd�dS|d}|d}t||d|�\}}|s�tdt�q<td|�t	�
|�}|r<td|�q<WdS)	Nrrrz"usage: mailcap [MIMEtype file] ...r6zNo viewer found forz
Executing:zExit status:)�sysr�argv�showr-r.�printr�typerrF)	rYrr:�argsrG�filerMrL�stsrrrrBs&

rBcCs�td�xt�D]}td|�qWt�|s4t�}td�t�t|�}xX|D]P}t|�||}x:|D]2}t|�}x|D]}td|||�q|Wt�qjWqPWdS)NzMailcap files:�	zMailcap entries:z  %-15s)r\rrrP)r�fnZckeysr]rKrL�keys�krrrr[s"


r[�__main__)N)rr �re�__all__r	�compile�searchrC�Warningr
rrr$rr,r8rrDrErVrBr[rrrrr�<module>s()

)