HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1991111/cwd/usr/lib/python3/dist-packages/reportbug/__pycache__/
Upload File :
Current File : //proc/1991111/cwd/usr/lib/python3/dist-packages/reportbug/__pycache__/mailer.cpython-311.pyc
�

�&=d����ddlZddlZddlZddlZddlZddlZddlZddlmZdZ	Gd�d��Z
Gd�de
��ZGd	�d
e
��ZGd�de
��Z
ed
��ed��e
d��e
d��e��e
dd���e
d��e
d��e
dd���e
dd���e
dd���e
dd���e
dd���d�
Zgd�Zd�Zd�Zd�ZdS)�N�)�
BadMessagei�c�&�eZdZdd�Zd�Zgfd�ZdS)�MuaTc�`�||_|���d|_||_dS)Nr)�_command�split�
executable�needs_terminal)�self�commandrs   �2/usr/lib/python3/dist-packages/reportbug/mailer.py�__init__zMua.__init__&s+����
�!�-�-�/�/�!�,���,�����c�~�tj�|��otj|tj��S)N)�os�path�isfile�access�R_OK)r�afiles  r�_check_attachablezMua._check_attachable+s)���w�~�~�e�$�$�B���5�"�'�)B�)B�Brc�T�|j}d|vr|dz
}|tj|��z}|S)N�%s� %s)r�shlex�quote)r�filename�attachments�cmds    r�get_send_commandzMua.get_send_command.s4���m���s�?�?��5�L�C��E�K��)�)�)���
rN)T)�__name__�
__module__�__qualname__rrr!�rrrr%sS������-�-�-�-�
C�C�C�68������rrc��eZdZgfd�ZdS)�Muttc����j}d|vr|dz
}|tj|��z}|r+�fd�|D��}|r|dd�|��zz
}|S)Nrrc���g|]H}��|���tjtj�|������ISr%)rrrrr�abspath��.0�ars  �r�
<listcomp>z)Mutt.get_send_command.<locals>.<listcomp>=sZ���F�F�F��4�+A�+A�!�+D�+D�F�5�;�r�w���q�1�1�2�2�F�F�Frz -a � )rrr�join)rrrr �atts`    rr!zMutt.get_send_command7s�����m���s�?�?��5�L�C��E�K��)�)�)���	.�F�F�F�F�'�F�F�F�C��
.��v�����
�
�-�-���
rN)r"r#r$r!r%rrr'r'6s+������57�
�
�
�
�
�
rr'c��eZdZd�Zgfd�ZdS)�Gnusc�"�d|_d|_dS)N�emacsclientT)r
r)rs rrz
Gnus.__init__Es��'���"����rc�t�d}tjdd|��}tj||z��}d|�d|��}|S)Nz�(progn
                      (load-file "/usr/share/reportbug/reportbug.el")
                      (tfheen-reportbug-insert-template "%s"))z["\\]z\\\g<0>zemacsclient --no-wait --eval z 2>/dev/null || emacs --eval )�re�subrr)rrr�elispr s     rr!zGnus.get_send_commandIsN��B���6�*�l�H�=�=����E�H�,�-�-���RW�RW�RW�Y^�Y^�_���
rN)r"r#r$rr!r%rrr3r3Ds<������#�#�#�68������rr3c�.�eZdZd�Zd�Zgfd�Zgfd�ZdS)�Mailtoc�F�tj�|dd���S)N�/�replace)�safe�errors)�urllib�parser)r�inss  r�_uqz
Mailto._uqTs���|�!�!�#�C�	�!�B�B�Brc��d}||}|rP|�d�|�������}d�||��}|S)N�z{}={}&)rDr0�
splitlines�format)r�hdr�msg�parmstr�hd�contents      r�_get_headerparamzMailto._get_headerparamWsU����
��X��
�	4��h�h�r�w�w�r�}�}���7�7�8�8�G��o�o�c�7�3�3�G��rc���d}|��d�|d�������z
}|dz
}dD]}|��||��z
}�|���r|�d��S|r(�fd�|D��}|r|d�|��z
}|�d�	���d
���}|r�|dz��|��z}t|��tkrS|dd
�}|std���|dz
}|dz��|��z}t|��tk�S|}|�d��S)Nzmailto:rF�to�?)�subject�cc�bccz?&c	����g|]\}��|���d���tj�|��������]S)z
attach={}&)rrHrDrrr*r+s  �rr.z)Mailto._msg_to_mailto.<locals>.<listcomp>msj���M�M�M��$�2H�2H��2K�2K�M�,�-�-�d�h�h�r�w���q�7I�7I�.J�.J�K�K�M�M�MrT)�decoder>)r@zbody=i0���zunreasonable messagez;

[ MAILBODY EXCEEDED REASONABLE LENGTH, OUTPUT TRUNCATED ])rDr0rGrN�is_multipart�rstrip�get_payloadrV�len�MAX_ARG_LENGTHr)rrJr�mailtorI�
attstrlist�body�
try_mailtos`       r�_msg_to_mailtozMailto._msg_to_mailtoas�������$�(�(�2�7�7�3�t�9�#7�#7�#9�#9�:�:�;�;�;���#�
��+�	6�	6�C��d�+�+�C��5�5�5�F�F������	'��=�=��&�&�&��	.�M�M�M�M�#.�M�M�M�J��
.��"�'�'�*�-�-�-�����d��+�+�2�2�)�2�D�D���		 ��'�)�D�H�H�T�N�N�:�J��j�/�/�N�2�2��F�U�F�|���=�$�%;�<�<�<��W�W��#�g�-�������>�
�
�j�/�/�N�2�2� �F��}�}�T�"�"�"rc��t|d��5}tj|tjj���}ddd��n#1swxYwYd�|j|�||����}|S)N�r)�policyz{} "{}")�open�email�message_from_filerc�compat32rHr
r`)rrr�fp�messager s      rr!zMailto.get_send_command�s���
�(�C�
 �
 �	P�B��-�b���9N�O�O�O�G�	P�	P�	P�	P�	P�	P�	P�	P�	P�	P�	P����	P�	P�	P�	P����t���0C�0C�G�[�0Y�0Y�Z�Z���
s�&A�A�
AN)r"r#r$rDrNr`r!r%rrr;r;Ssg������C�C�C����/1�#�#�#�#�>68������rr;zmutt -Hz
neomutt -Hz/usr/bin/mh/comp -use -filezclaws-mail --compose-from-fileF)rzalpine -urlz	pine -url�	evolution�kmailzthunderbird -composezsylpheed --compose�	xdg-email)
�mutt�neomutt�mh�nmh�gnus�
claws-mail�alpine�pinerjrk�thunderbird�sylpheedrl)rrrjrkrurvc�j�t|t��s|t���vrdSdS)z�
    Check if the mua is supported by reportbug

    Parameters
    ----------
    mua : Mua instance or str
        mail user agent

    Returns
    -------
    bool
        True if supported, otherwise False
    TF)�
isinstancer�MUA�keys��muas r�mua_is_supportedr}�s2���#�s����s�c�h�h�j�j�0�0��t��5rc��t|t��s 	t|}n#t$rYdSwxYwt	j|j��rdSdS)z�
    Check if the mua is available on the system

    Parameters
    ----------
    mua : Mua instance or str
        mail user agent

    Returns
    -------
    bool
        True if available, otherwise False
    FT)rxrry�KeyError�shutil�whichr
r{s r�
mua_existsr��sf���c�3����	��c�(�C�C���	�	�	��5�5�	����
�|�C�N�#�#���t��5s�
%�
3�3c��dtjvsdtjvrdSt|t��r|j}|t
vrdS|dkrdtjvrdSdS)a2
    Check if the mua can run in the current environment

    Some MUAs need a graphical environment and cannot run on a text
    console.

    Parameters
    ----------
    mua : Mua instance or str
        mail user agent

    Returns
    -------
    bool
        True if it can run, otherwise False
    �DISPLAY�WAYLAND_DISPLAYTFrl�MAILER)r�environrxrr
�MUA_NEEDS_DISPLAYr{s r�mua_can_runr��sn��"	�R�Z��� �B�J�.�.��t��#�s�����n��
�����u�
�k���h�b�j�8�8��u��4r)re�email.policyrr7rr�rA�
exceptionsrr[rr'r3r;ryr�r}r�r�r%rr�<module>r�s&��0
��������	�	�	�	�	�	�	�	�����
�
�
�
�
�
�
�
�"�"�"�"�"�"�����������"�����3���������3����2�2�2�2�2�S�2�2�2�l
�D��O�O��t�L�!�!�

�#�+�
,�
,��3�,�-�-��D�F�F��#�6�u�M�M�M��f�]�#�#��F�;������E�:�:�:�
�V�G�E�
2�
2�
2��6�0��G�G�G���+�E�B�B�B����E�:�:�:���� �������&���0����r