%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/certbot/_internal/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/certbot/_internal/__pycache__/eff.cpython-312.pyc

�

M/�e���2�dZddlZddlmZddlZddlmZddlmZddl	m
Z
ddl	mZddlm
Zeje�Zd	ej$d
e
ddfd�Zd	ej$d
ee
ddfd
�Zdefd�Zdeddfd�Zdej2ddfd�Zddeeddfd�Zy)z'Subscribes users to the EFF newsletter.�N)�Optional)�
configuration)�	constants)�Account)�AccountFileStorage)�util�config�acc�returnc��|jdury|jdurD|j�td�nm|jj	|j��|_nA|jr5t�r+|jj	|j��|_|jjrt|�}|j|�yy)a�High level function to store potential EFF newsletter subscriptions.

    The user may be asked if they want to sign up for the newsletter if
    they have not given their explicit approval or refusal using --eff-mail
    or --no-eff-mail flag.

    Decision about EFF subscription will be stored in the account metadata.

    :param configuration.NamespaceConfig config: Client configuration.
    :param Account acc: Current client account.

    FNTz$you didn't provide an e-mail address��register_to_eff)	�	eff_email�email�_report_failure�meta�update�_want_subscriptionrr�update_meta�r	r
�storages   �7/usr/lib/python3/dist-packages/certbot/_internal/eff.py�prepare_subscriptionrs������5� ��
���4���<�<���B�C��x�x���v�|�|��D�C�H�	���,�.��8�8�?�?�6�<�<�?�@���
�x�x���$�V�,�����C� � �c��|js|sy|jjr]t|jj�|jj	d��|_t|�}|j
|�yy)aHigh level function to take care of EFF newsletter subscriptions.

    Once subscription is handled, it will not be handled again.

    :param configuration.NamespaceConfig config: Client configuration.
    :param Account acc: Current client account.

    Nr
)�dry_runrr�	subscriberrrrs   r�handle_subscriptionr,sb���~�~�S��
�x�x����#�(�(�*�*�+��8�8�?�?�4�?�8���$�V�,�����C� � rc�4�d}tj|d��S)z�Does the user want to be subscribed to the EFF newsletter?

    :returns: True if we should subscribe the user, otherwise, False
    :rtype: bool

    aoWould you be willing, once your first certificate is successfully issued, to share your email address with the Electronic Frontier Foundation, a founding partner of the Let's Encrypt project and the non-profit organization that develops Certbot? We'd like to send you email about our work encrypting the web, EFF news, campaigns, and ways to support digital freedom. F)�default)�display_util�yesno)�prompts rrr?s"��	N�����f�e�4�4rrc���tj}d|dd�}tjd|�tj	d||�tt
j||d���y)	zhSubscribe the user to the EFF mailing list.

    :param str email: the e-mail address to subscribe

    �json�%eff_supporters_library_subscribe_form)�	data_typer�form_idz.Subscribe to the EFF mailing list (email: %s).zSending POST request to %s:
%s�<)�data�timeoutN)r�EFF_SUBSCRIBE_URI�logger�info�debug�_check_response�requests�post)r�urlr*s   rrrOsW���
%�
%�C���>�@�D��K�K�@�%�H�
�L�L�2�C��>��H�M�M�#�D�"�=�>r�responsec�4�tjd|j�	|j�|j	�dstd�yy#tjj$r
t�Yyttf$rtd�YywxYw)z�Check for errors in the server's response.

    If an error occurred, it will be reported to the user.

    :param requests.Response response: the server's response to the
        subscription request

    zReceived response:
%s�statusz)your e-mail address appears to be invalidz,there was a problem with the server responseN)r-r/�content�raise_for_statusr%rr1�
exceptions�	HTTPError�
ValueError�KeyError)r4s rr0r0^s����L�L�)�8�+;�+;�<�H��!�!�#��}�}��x�(��G�H�)�����(�(������!�H��F�G�H�s�.A�'B�;B�B�reasonc��dg}|�"|jd�|j|�|jd�tjdj|��y)z�Notify the user of failing to sign them up for the newsletter.

    :param reason: a phrase describing what the problem was
        beginning with a lowercase letter and no closing punctuation
    :type reason: `str` or `None`

    z4We were unable to subscribe you the EFF mailing listNz	 because z:. You can try again later by visiting https://act.eff.org.�)�appendr!�notify�join)r=�msgs  rrrrsN��B�
B�C�
���
�
�;���
�
�6���J�J�K�L���������%r)N)�__doc__�logging�typingrr1�certbotr�certbot._internalr�certbot._internal.accountrr�certbot.displayrr!�	getLogger�__name__r-�NamespaceConfigrr�boolr�strr�Responser0r�rr�<module>rRs���-����!�'�-�8�0�	��	�	�8�	$��!��!>�!>�!�W�!�QU�!�8!�
� =� =�!�H�W�DU�!�Z^�!�&
5�D�
5� ?�S�?�T�?�H�h�/�/�H�D�H�(
&�H�S�M�
&�T�
&r

Zerion Mini Shell 1.0