Spade

Mini Shell

Directory:~$ /usr/lib/python2.7/site-packages/certbot/_internal/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ //usr/lib/python2.7/site-packages/certbot/_internal/eff.pyo

�
���_c@s�dZddlZddlZddlZddlmZddlmZddl	m
Zddlm
Z
ddlmZddlmZdd	lmZeje�Zd
�Zd�Zd�Zd
�Zd�Zdd�ZdS(s'Subscribes users to
the EFF newsletter.i����N(tOptional(t
interfaces(tutil(t	constants(tAccount(tAccountFileStorage(tIConfigcCs�|jtkrdS|jtkr\|jdkr>td�q�|jjd|j�|_n0|jr�t�r�|jjd|j�|_n|jj	r�t
|�}|j|�ndS(s�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 IConfig config: Client configuration.
    :param Account acc: Current client account.

    Ns$you didn't provide an e-mail
addresstregister_to_eff(t	eff_emailtFalsetTruetemailtNonet_report_failuretmetatupdatet_want_subscriptionRRtupdate_meta(tconfigtacctstorage((s9/usr/lib/python2.7/site-packages/certbot/_internal/eff.pytprepare_subscriptions
cCsa|jr
dS|jjr]t|jj�|jjdd�|_t|�}|j|�ndS(s�High
level function to take care of EFF newsletter subscriptions.

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

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

   
NR(tdry_runRRt	subscribeRRRR(RRR((s9/usr/lib/python2.7/site-packages/certbot/_internal/eff.pythandle_subscription0s
	cCs.d}tjjtj�}|j|dt�S(s�Does the user want
to be subscribed to the EFF newsletter?

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

    soWould 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. tdefault(tzopet	componentt
getUtilityRtIDisplaytyesnoR	(tprompttdisplay((s9/usr/lib/python2.7/site-packages/certbot/_internal/eff.pyRDs	cCsdtj}idd6|d6dd6}tjd|�tjd||�ttj|d|��d	S(
shSubscribe the user to the EFF mailing list.

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

   
tjsont	data_typeRt%eff_supporters_library_subscribe_formtform_ids.Subscribe
to the EFF mailing list (email: %s).sSending POST request to %s:
%stdataN(RtEFF_SUBSCRIBE_URItloggertinfotdebugt_check_responsetrequeststpost(RturlR%((s9/usr/lib/python2.7/site-packages/certbot/_internal/eff.pyRVs	

cCs�tjd|j�y+|j�|j�ds=td�nWn>tjjk
r^t�n!t	t
fk
r~td�nXdS(s�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

    sReceived response:
%ststatuss)your e-mail address appears to be invalids,there was a problem
with the server responseN(R'R)tcontenttraise_for_statusR!R
R+t
exceptionst	HTTPErrort
ValueErrortKeyError(tresponse((s9/usr/lib/python2.7/site-packages/certbot/_internal/eff.pyR*fs


cCsYdg}|dk	r2|jd�|j|�n|jd�tjdj|��dS(s�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`

    s4We were unable to subscribe you the EFF mailing lists	 because s:.
You can try again later by visiting
https://act.eff.org.tN(Rtappendtdisplay_utiltnotifytjoin(treasontmsg((s9/usr/lib/python2.7/site-packages/certbot/_internal/eff.pyR
{s		

(t__doc__tloggingR+tzope.componentRtacme.magic_typingRtcertbotRtcertbot.displayRR8tcertbot._internalRtcertbot._internal.accountRRtcertbot.interfacesRt	getLoggert__name__R'RRRRR*RR
(((s9/usr/lib/python2.7/site-packages/certbot/_internal/eff.pyt<module>s"