ok

Mini Shell

Direktori : /opt/alt/python36/lib64/python3.6/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/__pycache__/mailcap.cpython-36.opt-2.pyc

3

��2a��@s�ddlZddlZddgZdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	ddgfdd�Z
ddd�Zgfdd�Zdd�Z
dd�Zdd�Zedkr�e�dS) �N�getcaps�	findmatchcCsd|krd|dfSdSdS)N�linenor�)rr�)�entryrr�,/opt/alt/python36/lib64/python3.6/mailcap.py�lineno_sort_key	sr	cCs�i}d}x�t�D]�}yt|d�}Wntk
r8wYnX|�t||�\}}WdQRXx6|j�D]*\}}||kr||||<qb|||||<qbWqW|S)Nr�r)�listmailcapfiles�open�OSError�_readmailcapfile�items)�capsrZmailcap�fpZmorecaps�key�valuerrrrs

cCsPdtjkr"tjd}|jtj�}n*dtjkr8tjd}nd}|ddddg}|S)NZMAILCAPS�HOME�.z	/.mailcapz/etc/mailcapz/usr/etc/mailcapz/usr/local/etc/mailcap)�os�environ�split�pathsep)ZpathstrZmailcaps�homerrrr-s


rcCs tjdtd�t|d�\}}|S)Nz2readmailcapfile is deprecated, use getcaps instead�)�warnings�warn�DeprecationWarningr)rr�_rrr�readmailcapfile?sr c	Csi}x�|j�}|sP|ddks|j�dkr.q|}x4|d
d�dkrf|j�}|sTd}|dd�|}q4Wt|�\}}|oz|s~q|dk	r�||d<|d7}|jd	�}x$tt|��D]}||j�||<q�Wd	j|�j�}||kr�||j|�q|g||<qW||fS)Nr�#�rz\
�
rr�/���r%)	�readline�strip�	parseliner�range�len�join�lower�append)	rrr�lineZnextliner�fields�types�jrrrrGs6	
rc
Cs�g}dt|�}}x.||kr@t|||�\}}|j|�|d}qWt|�dkrRdS|d|d|dd�}}}d|i}x^|D]V}|jd�}|dkr�|}d}	n$|d|�j�}||dd�j�}	||kr�q�|	||<q�W||fS)Nrrr�view�=r")NN)r*�
parsefieldr-�findr')
r.r/�i�n�fieldrr2�restZfkeyZfvaluerrrr(ps*

 

r(cCsT|}x:||kr>||}|dkr"Pq|dkr4|d}q|d}qW|||�j�|fS)N�;�\rr)r')r.r6r7�start�crrrr4�s

r4r2z	/dev/nullc	Csbt|||�}xP|D]H}d|krBt|d||�}|rBtj|�dkrBqt|||||�}||fSWdS)N�testr)NN)�lookup�substr�system)	r�MIMEtyper�filename�plist�entries�er>�commandrrrr�s	

cslg}||kr|||}|jd�}|dd}||krB|||}�dk	r\�fdd�|D�}t|td�}|S)Nr$rz/*csg|]}�|kr|�qSrr)�.0rF)rrr�
<listcomp>�szlookup.<locals>.<listcomp>)r)r�sortedr	)rrBrrEZ	MIMEtypesr)rrr?�s
r?c
Csd}dt|�}}x�||k�r||}|d}|dkr`|dkrV|||d�}|d}||}q||}|d}|dkr�||}q|dkr�||}q|dkr�||}q|dkr�|}x ||kr�||d	kr�|d}q�W|||�}	|d}|t|	|�}q|d|}qW|S)
Nr"rr�%r;�s�t�{�})r*�	findparam)
r8rBrCrD�resr6r7r=r<�namerrrr@�s6



r@cCsF|j�d}t|�}x,|D]$}|d|�j�|kr||d�SqWdS)Nr3r")r,r*)rRrDr7�prrrrP�s
rPc	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	j
|�}|r<td|�q<WdS)	Nrrrz"usage: mailcap [MIMEtype file] ...r2zNo viewer found forz
Executing:zExit status:)�sysr�argv�showr)r*�printr�typerrA)	rTrr6�argsrB�filerGrF�stsrrrr>�s&

r>cCs�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)rWrrrJ)r�fnZckeysrXrErF�keys�krrrrVs"


rV�__main__)N)rr�__all__r	rrr rr(r4rr?r@rPr>rV�__name__rrrr�<module>s"
)

 

Zerion Mini Shell 1.0