KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.41 (Ubuntu)
System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64
User : www-data ( 33)
PHP Version : 8.2.12
Disable Function : NONE
Directory :  /lib/python3/dist-packages/certbot/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/certbot/__pycache__/eff.cpython-38.pyc
U

�]B�@sldZddlZddlZddlZddlmZddlmZe�e	�Z
dd�Zdd�Zd	d
�Z
dd�Zdd
d�ZdS)z'Subscribes users to the EFF newsletter.�N)�	constants)�
interfacescCsB|jdkr|jrtd�dS|jdkr.t�|_|jr>t|j�dS)z�High level function to take care of EFF newsletter subscriptions.

    The user may be asked if they want to sign up for the newsletter if
    they have not already specified.

    :param .IConfig config: Client configuration.

    Nz$you didn't provide an e-mail address)�emailZ	eff_email�_report_failure�_want_subscription�	subscribe)Zconfig�r�-/usr/lib/python3/dist-packages/certbot/eff.py�handle_subscriptions	

r
cCs d}tj�tj�}|j|dd�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

    a:Would you be willing 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)�zope�	component�
getUtilityrZIDisplayZyesno)�promptZdisplayrrr	r!s�rcCs6tj}d|dd�}t�d||�ttj||d��dS)zhSubscribe the user to the EFF mailing list.

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

    �jsonZ%eff_supporters_library_subscribe_form)Z	data_typerZform_idzSending POST request to %s:
%s)�dataN)rZEFF_SUBSCRIBE_URI�logger�debug�_check_response�requestsZpost)rZurlrrrr	r2s�rc	Cspt�d|j�z |��|��ds,td�Wn<tjjk
rLt�Yn t	t
fk
rjtd�YnXdS)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:
%sZstatusz)your e-mail address appears to be invalidz,there was a problem with the server responseN)rrZcontentZraise_for_statusrrr�
exceptionsZ	HTTPError�
ValueError�KeyError)Zresponserrr	r@s	
rcCsRdg}|dk	r"|�d�|�|�|�d�tj�tj�}|�d�|�|j�dS)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r
rrZ	IReporterZadd_message�joinZLOW_PRIORITY)�reason�msgZreporterrrr	rTs


r)N)�__doc__ZloggingrZzope.componentrZcertbotrrZ	getLogger�__name__rr
rrrrrrrr	�<module>s


Anon7 - 2021