����JFIF���������
1#@!#!123s
D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
python312
/
lib64
/
python3.12
/
__pycache__
/
Filename :
mailcap.cpython-312.pyc
back
Copy
� ����4[Yhu$���������������������������d�Z�ddlZddlZddlZddgZdZ�ej������������������eed���������d��Z�ej������������������d �������j������������������Z�G�d ��de�������Z d��Zd ��Zd��Zd��Zd��Zd��Zddg�fd�Zdd�Zg�fd�Zd��Zd��Zd��Zedk(��r�e���������yy)z%Mailcap file handling. See RFC 1524.�����N�getcaps� findmatchztThe {name} module is deprecated and will be removed in Python {remove}. See the mimetypes module for an alternative.)����� ���)�removec�����������������������d|�v�rd|�d���fS�y)N�linenor���)����r�����)�entrys��� �./opt/alt/python312/lib64/python3.12/mailcap.py�lineno_sort_keyr������s�������5���%��/�!�!������z[^\xa1-\U0010FFFF\w@+=:,./-]c�������������������������e�Zd�ZdZy)�UnsafeMailcapInputz)Warning raised when refusing unsafe inputN)�__name__� __module__�__qualname__�__doc__r���r���r ���r���r������s������3r���r���c������������������� ����i�}�d}t����������������D�]V��} �t��������|d�������}|5��t��������||�������\��}}ddd��������j ��������������������������D�]��\��}}||�vr||�|<����|�|���|z���|�|<������X�|�S�#�t��������$�r�Y��fw�xY�w#�1�sw�Y����IxY�w)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)�capsr ����mailcap�fp�morecaps�key�values��� r ���r���r������s���������D� �F�#�%�� ��g�s�#�B���/��F�;��H�f���"�.�.�*�J�C���$�;�!��S� � ��I��-��S� � �+��&���K����� �� �� �R�s����A*�A9�* A6�5A6�9B c�������������������������dt���������j������������������v�r4t���������j������������������d���}�|�j������������������t���������j�������������������������}|S�dt���������j������������������v�rt���������j������������������d���}nd}|dz���dddg}|S�)z7Return a list of all mailcap files found on the system.�MAILCAPS�HOME�.z /.mailcapz/etc/mailcapz/usr/etc/mailcapz/usr/local/etc/mailcap)�os�environ�split�pathsep)�pathstr�mailcaps�homes��� r ���r���r���9���sv��������R�Z�Z���*�*�Z�(���=�=����,����O���R�Z�Z���:�:�f�%�D���D��;�&��"�$<�>���Or���c������������������Z�����t��������j������������������dt��������d��������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���)r���r����_s��� r ����readmailcapfiler4���K���s+�������M�M�F�$�a�)��r�4�(�G�D�!��Kr���c������������������(����i�}|�j��������������������������x}r�|d���dk(��s|j��������������������������dk(��r�.|}|dd�dk(��r%|�j��������������������������}|sd}|dd�|z���}|dd�dk(��r�%t��������|�������\��}}|r|s�p|� ||d<���|d z ��}|j������������������d �������}t ��������t��������|��������������D�]��}||���j��������������������������||<�����d j ������������������|�������j��������������������������}||v�r||���j������������������|��������n|g||<���|�j��������������������������x}r��||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\ � r ���r ����/) �readline�strip� parseliner)����range�len�join�lower�append) r���r ���r����line�nextliner!����fields�types�js ��� r ���r���r���S���s7�������D��+�+�-� �$� ���7�c�>�T�Z�Z�\�R�/�����r�s�m�v�%��{�{�}�H���X����9�x�'�D���r�s�m�v�%� � ��o���V������%�F�8���a�K�F�� � �#����s�5�z�"�A��Q�x�~�~�'�E�!�H��#��h�h�u�o�#�#�%���$�;���I���V�$���D��I�5��+�+�-� �$� �6���<�r���c������������������x����g�}dt��������|��������}}||k��r,t��������|�||�������\��}}|j������������������|��������|dz���}||k��r�,t��������|�������dk��ry|d���|d���|dd�}}}d|i}|D�]P��}|j������������������d�������}|dk��r|}d} n)|d|�j ��������������������������}||dz���d�j ��������������������������} ||v�r�L| ||<����R�||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. r���r ���r/����NNN�view�=r7���)r?���� parsefieldrB����findr<���) rC���rE����i�n�fieldr!���rJ����rest�fkey�fvalues ��� r ���r=���r=���z���s���������F��c�$�i�q�A� �a�%��d�A�q�)���q�� � �e�� �a�C����a�%���6�{�Q����Q�i����F�1�2�J�t��C��d�^�F����J�J�s�O���q�5��D��F���!�9�?�?�$�D��1�Q�3�4�[�&�&�(�F��6�>��!�F�4�L������;�r���c������������������|�����|}||k��r!|�|���}|dk(��rn|dk(��r|dz���}n|dz���}||k��r�!|�||�j��������������������������|fS�)z/Separate one key-value pair in a mailcap entry.�;�\r/���r ���)r<���)rC���rN���rO����start�cs��� r ���rL���rL�������s_������ �E� �a�%���G����8�� �$�Y��!��A��!��A���a�%����a�=��� �!�#�#r���rJ���z /dev/nullc����������������������t��������|�������r!d|�d�}t��������j������������������|t����������������yt ��������|�||�������}|D�]M��}d|v�r.t��������|d���||�������}|��|rt ��������j������������������|�������dk7��r�5t��������||���|||�������} | ��I| |fc�S��y)a��Find 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. z&Refusing to use mailcap with filename z . Use a safe temporary filename.rI����testr���)�_find_unsafer0���r1���r����lookup�substr'����system) r����MIMEtyper!����filename�plist�msg�entries�erZ����commands ��� r ���r���r�������s���������H��\d�f��� � �c�-�.���T�8�S�)�G� ���Q�;���6��H�e�4�D��|���� � �$��1�,����#���(�E�:�����A�:�����r���c������������������������g�}||�v�r||�|���z���}|j������������������d�������}|d���dz���}||�v�r||�|���z���}|�|D��cg�c] ��}||v�s�|���}}t��������|t����������������}|S�c�c}w�)Nr:���r���z/*)r!���)r)����sortedr���)r���r_���r!���rc���� MIMEtypesrd���s��� r ���r\���r\�������s��������G��4���D��N�*�����s�#�I���|�d�"�H��4���D��N�*�� ��%�2�g�����1�g��2��W�/�2�G��N���3s���� A�Ac������������������*����d}dt��������|��������}}||k��r�|�|���}|dz���}|dk7��r|dk(��r |�||dz����}|dz���}||z���}n�|�|���}|dz���}|dk(��r||z���}n�|dk(��r||z���}n�|dk(��r2t��������|�������r!d|�d �}t��������j������������������|t����������������y�||z���}nz|d k(��rm|} ||k��r|�|���dk7��r|dz���}||k��r |�|���dk7��r�|�| |�} |dz���}t��������| |�������}t��������|�������r$d|�d | �d�}t��������j������������������|t����������������y�||z���}n|dz���|z���}||k��r��|S�)Nr7���r���r ����%rV����s�tz!Refusing to substitute MIME type z into a shell command.�{�}z!Refusing to substitute parameter z (z) into a shell command)r?���r[���r0���r1���r���� findparam)rP���r_���r`���ra����resrN���rO���rX���rb���rW����name�params��� r ���r]���r]�������se����� �C��c�%�j�q�A� �a�%��!�H��!�A�#�a���8��D�y��!�A�a�C�L��a��c�!���'�C��a��A�a��c�!��C�x��A�g���c���H�n���c����)�Ya�c�C��M�M�#�'9�:���H�n���c�����!�e��a��C���!��A���!�e��a��C���U�1�~���a�C��!�$��.����&�]b�dh�i�C��M�M�#�'9�:���E�k�� ��C�i�!�m��E��a�%�F��Jr���c�����������������������|�j��������������������������dz���}�t��������|��������}|D�]��}|d�|�j��������������������������|�k(��s�||d��c�S��y)NrK���r7���)rA���r?���)rq���ra���rO����ps��� r ���ro���ro�������sI�������:�:�<�#��D��D� �A� ���R�a�5�;�;�=�D� ��Q�R�5�L����r���c������������������������dd�l�}�t����������������}|�j������������������dd��st��������|��������y�t ��������dt��������|�j�������������������������d�������D�]���}|�j������������������||dz����}t��������|�������dk��r t ��������d���������y�|d���}|d���}t��������||d|�������\��}}|st ��������dt�����������������^t ��������d|��������t��������j������������������|�������}t��������j������������������|�������}|s��t ��������d|�����������y�) Nr���r ���r/���z"usage: mailcap [MIMEtype file] ...rJ���zNo viewer found forz Executing:zExit status:)�sysr����argv�showr>���r?����printr����typer'���r^����waitstatus_to_exitcode) rv���r���rN����argsr_����filere���rd����stss ��� r ���rZ���rZ�����s���������9�D��8�8�A�B�<��T� �� �1�c�#�(�(�m�Q� '���x�x��!�A�#����t�9�q�=��6�7����7���A�w���t�X�v�t�<� �����'��.��,��(��)�)�G�$�C��+�+�C�0�C���n�c�*��(r���c������������������X����t��������d��������t����������������D�]��}t��������d|z�������������t�����������������|�s t����������������}�t��������d��������t�����������������t��������|��������}|D�]G��}t��������|��������|�|���}|D�]0��}t��������|�������}|D�]��}t��������d|z��||�������������t������������������2��I�y�)NzMailcap files:� zMailcap entries:z %-15s)ry���r���r���rg���)r����fn�ckeysrz���rc���rd����keys�ks��� r ���rx���rx�����s������� � ��� ��%��r� �"2� � �G��� �� � �� �G��4�L�E��� �d���t�*���A��!�9�D����i�!�m�Q�q�T�*����G� ���r����__main__)N)r���r'���r0����re�__all__�_DEPRECATION_MSG�_deprecatedr���r����compile�searchr[����Warningr���r���r���r4���r���r=���rL���r���r\���r]���ro���rZ���rx���r���r���r ����<module>r�������s�������+�� ���� ��[� !��#����������X�/���@����r�z�z�9�:�A�A��4���4��4�$�%�N�>$� �#)�;�b���6��,.��'�R�+�.�"��z���F��r���