Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : fdshops ( 1003)
PHP Version : 8.2.21
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/certbot/_internal/cli/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/certbot/_internal/cli/helpful.pyc
�
���_c@s�dZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
ZddlZddlm
ZddlmZmZddlmZddlmZddlm
Z
ddlmZdd	lmZdd
lmZddlmZddlmZddlmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*d
e+fd��YZ,dS(s$Certbot command line argument parseri����(tprint_functionN(t
interfaces(tAnytDict(tcrypto_util(terrors(tutil(tos(t	constants(thooks(
tSHORT_USAGEtCustomHelpFormattertflag_defaultt	VERB_HELPt
VERB_HELP_MAPtCOMMAND_OVERVIEWtHELP_AND_VERSION_USAGEt_Defaulttadd_domainstEXIT_ACTIONStZERO_ARG_ACTIONStARGPARSE_PARAMS_TO_REMOVEtHelpfulArgumentGrouptHelpfulArgumentParsercBs�eZdZed�ZdddddgZd�Zd�Zd	�Zd
�Z	d�Z
d�Zd
�Zd�Z
d�Zd�Zd�Zdd�Zd�Zd�ZRS(s�Argparse Wrapper.

    This class wraps argparse, adding the ability to make --help less
    verbose, and request help on specific subcategories at a time, eg
    'certbot --help security' for security options.

    c
Cs�ddlm}i|jd6|jd6|jd6|jd6|jd6|jd6|jd	6|jd
6|j	d6|j
d6|jd
6|jd6|jd6|j
d6|jd6|jd6|_ytjjtj�j|_Wn,tjk
rtjtj�j|_nXdddddg}|t|j�|jdg7}t|�}||dg|_!||_"||_#|j#r�|j#ddkr�d|j#d<n|j$�|j%d|j!�}|j%d|j!�}t&|t'�r�t&|t'�r�|p�||_(n!t&|t)j*�r|n||_(|j+||j(�}	|j,|j(�|_-i|_.i|_/t0j1ddd|	d t2d!d"d#gd$t3d%�d&d'j4d(j5t3d%����|_6t7|j6_8dS()Ni����(tmaintauthtcertonlytruntinstalltpluginstregistertupdate_accountt
unregistertrenewtrevoketrollbackt
everythingtupdate_symlinkstcertificatestdeletetenhancetalltsecuritytpathst
automationttestingtmanageithelps--helps-htprogtcertbottusagetformatter_classtargs_for_setting_config_paths-cs--configtdefault_config_filestconfig_filestconfig_arg_help_messages"path to config file (default: {0})s and (9tcertbot._internalRRRRtplugins_cmdRRR R!R"R#R%R&R'R(tVERBStzopet	componentt
getUtilityRtIDisplaytnotificationtnotifytzope_interfacestComponentLookupErrortdisplay_utiltNoninteractiveDisplaytsyststdouttlisttCOMMANDS_TOPICStNonethelp_topicstdetect_defaultstargstdetermine_verbtprescan_for_flagt
isinstancetboolthelp_argtsixtstring_typest
_usage_stringtdetermine_help_topicstvisible_topicstgroupstdefaultstconfigargparset	ArgParserRRtformattjointparsertFalset_add_config_file_help(
tselfRLRRKRtHELP_TOPICStplugin_namesthelp1thelp2tshort_usage((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pyt__init__5sf














	!		
!			tcommandtcommandst
subcommandtsubcommandstverbscCsutd�tD��}d}xHtt�D]:\}}|jdd�}|dj||d|�7}q)W|d7}|S(Ncss|]}t|�VqdS(N(tlen(t.0tv((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pys	<genexpr>�ss,The full list of available SUBCOMMANDS is:

tshortts{0:<{length}}     {1}
tlengthsG
You can get more help on a specific subcommand with --help SUBCOMMAND
(tmaxRtsortedR
tgetR[(R`tlongestttexttverbtpropstdoc((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pyt_list_subcommands�s 
cCsd|krd}nd}d|kr0d}nd}t}|tkrw|j|t||ft�tjd�n�||jkr�|j||j��tjd�nS|dkr�|t||f7}n0t	j
|i�j
d	d
�}|r�|n|}|S(s#Make usage strings late so that plugins can be initialised late

        :param plugins: all discovered plugins
        :param help_arg: False for none; True for --help; "TOPIC" for --help TOPIC
        :rtype: str
        :returns: a short usage string for the top of --help TOPIC)
        tnginxsH--nginx           Use the Nginx plugin for authentication & installations+(the certbot nginx plugin is not installed)tapachesI--apache          Use the Apache plugin for authentication & installations,(the certbot apache plugin is not installed)iR)R2N(R
tTrueR@RRREtexitRHRzRRtRI(R`RRQt	nginx_doct
apache_docR2tcustom((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pyRT�s$		cCsr|jdkrnx\|jjj�D]E\}}|jd�r"d|kr"|jr[t�ng|_q"q"WndS(s8Make "certbot renew" safe if domains are set in cli.ini.R!tconfig_filetdomainsN(RwR]t_source_to_settingstitemst
startswithRKRR�(R`tparsed_argstsourcetflags((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pyt&remove_config_file_domains_for_renewal�scs��jj�j�}�j�j|_�j|_�j|��jrN|S�fd�t|�D��_	�jdkr�|j
r�tjdj
tj���nt|_n|j
r�|jr�tjdj
tj���n|js�|jr�j|�n|jr�j|�n|jr/t|_n|jrHtj|�n|jrtd�|jD��rtjd��qn|jr�|jr�tjd��nt |j!t"�r�t#|j!�dkr�tjd	��n|S(
s�Parses command line arguments and returns the result.

        :returns: parsed command line arguments
        :rtype: argparse.Namespace

        cs.i|]$}tj�jj|��|�qS((tcopytdeepcopyR]tget_default(Rmtkey(R`(sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pys
<dictcomp>�s	R!s{0} cannot be used with renews.Flag for non-interactive mode and {0} conflictcss|]}tj|�VqdS(N(Rtis_wildcard_domain(Rmtd((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pys	<genexpr>�ssFUsing --allow-subset-of-names with a wildcard domain is not supported.s@Parameters --hsts and --auto-hsts cannot be used simultaneously.is8Only *one* --key-type type may be provided at this time.($R]t
parse_argsRLR:RwtfuncR�RKtvarsRXtforce_interactiveRtErrorR[RtFORCE_INTERACTIVE_FLAGR}tnoninteractive_modetstagingtdry_runtset_test_servertcsrt
handle_csrtmust_stapletstapletvalidate_hooksR	tallow_subset_of_namestanyR�thstst	auto_hstsROtkey_typeRGRl(R`R�((R`sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pyR��sH
						'cCs�td�tjf}|jr?|j|kr?tjd��n|j|kr]tj|_n|jr�|jdkr�tjd|j��nt	|_
|_tjtj
j|jtjd��r�t	|_t	|_q�ndS(	sGWe have --staging/--dry-run; perform sanity check and set config.servertservers'--server value conflicts with --stagingRR!sN--dry-run currently only works with the 'certonly' or 'renew' subcommands (%r)t*N(scertonlysrenew(RRtSTAGING_URIR�R�RR�R�RwR}tbreak_my_certstglobRtpathR\t
config_dirtACCOUNTS_DIRttostregister_unsafely_without_email(R`R�tdefault_servers((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pyR��s
		'	c
Cs|jdkr!tjd��n|jr<tjd��n|jdd!\}}tj||�\}}}x|D]}t||�qtW|s�tjd|jd��n||f|_d�|D�}t	|j
�}	||	krtjdjd	j
|�d	j
|	����nd
S(sProcess a --csr flag.Rs�Currently, a CSR file may only be specified when obtaining a new or replacement via the certonly command. Please try the certonly command instead.s1--allow-subset-of-names cannot be used with --csriisJUnfortunately, your CSR %s needs to have a SubjectAltName for every domaincSsh|]}|j��qS((tlower(RmR�((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pys	<setcomp>(s	sMInconsistent domain requests:
From the CSR: {0}
From command line/config: {1}s, N(RwRR�R�R�Rtimport_csr_fileRt
actual_csrtsetR�tConfigurationErrorR[R\(
R`R�tcsrfiletcontentsttypR�R�tdomaintcsr_domainstconfig_domains((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pyR�s&	
cCs�d|jksd|jkr+d|_dSxyt|j�D]h\}}||jkr;|}|dkrqd}n|dkr�d}n||_|jj|�dSq;Wd|_dS(	s�Determines the verb/subcommand provided by the user.

        This function works around some of the limitations of argparse.

        s-hs--helpR/NRRR$R(RLRwt	enumerateR:tpop(R`tittokenRw((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pyRM0s				cCsb||jkrtS|jj|�}y%|j|d}||krI|SWntk
r]nXtS(ssChecks cli input for flags.

        Check for a flag, which accepts a fixed set of possible arguments, in
        the command line; we will use this information to configure argparse's
        help correctly.  Return the flag's argument, if it has one that matches
        the sequence @possible_arguments; otherwise return whether the flag is
        present.

        i(RLR^tindext
IndexErrorR}(R`tflagtpossible_argumentstpostnxt((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pyRNHs

cOs|jd�}|tjkr5|jj||�dSt|t�ri|j|kr\|jn|d}n|}|jr�|j	|�}n|j
|r�||jkr�|j|}|j||�q�|jj||�n tj
|d<|jj||�dS(s1Add a new command line argument.

        :param topics: str or [str] help topic(s) this should be listed under,
                       or None for options that don't fit under a specific
                       topic which will only be shown in "--help all" output.
                       The first entry determines where the flag lives in the
                       "--help all" output (None -> "optional arguments").
        :param list *args: the names of this argument flag
        :param dict **kwargs: various argparse settings for this argument

        tactionNiR/(RtRtDeprecatedArgumentActionR]tadd_argumentRORGRQRKt#modify_kwargs_for_default_detectionRVRWtargparsetSUPPRESS(R`ttopicsRLtkwargsR�ttopictgroup((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pytadd]s 	%	


cKso|jdd�}|tkrk|tkr0dnd|d<t�|d<x!tD]}|j|d�qNWn|S(s_Modify an arg so we can check if it was set by the user.

        Changes the parameters given to argparse when adding an argument
        so we can properly detect if the value was set by the user.

        :param dict kwargs: various argparse settings for this argument

        :returns: a modified versions of kwargs
        :rtype: dict

        R�t
store_truetstoretdefaultN(RtRIRRRRR�(R`R�R�tparam((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pyR��s


cCs,tj|jd�}tj|||�dS(s�Adds a deprecated argument with the name argument_name.

        Deprecated arguments are not shown in the help. If they are used
        on the command line, a warning is shown stating that the
        argument is deprecated and no other action is taken.

        :param str argument_name: Name of deprecated argument.
        :param int nargs: Number of arguments the option takes.

        N(t	functoolstpartialR�RIRtadd_deprecated_argument(R`t
argument_nametnum_argstadd_func((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pyR��scKsx|j|rk|jj||�|j|<|jrkx3|D](}|j|j|dt|d�q9Wqknt||�S(s�Create a new argument group.

        This method must be called once for every topic, however, calls
        to this function are left next to the argument definitions for
        clarity.

        :param str topic: Name of the new argument group.
        :param str verbs: List of subcommands that should be documented as part of
                          this help group / topic

        :returns: The new argument group.
        :rtype: `HelpfulArgumentGroup`

        R/Ro(RVR]tadd_argument_groupRWRQR�RR(R`R�RkR�Rn((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pyt	add_group�s
	
,cCsOxHtj|�D]7\}}|j|d|j�}|jj||�qWdS(s�

        Let each of the plugins add its own command line arguments, which
        may or may not be displayed as help topics.

        tdescriptionN(RRt	iteritemsR�tlong_descriptiont
plugin_clstinject_parser_options(R`Rtnamet	plugin_eptparser_or_group((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pytadd_plugin_args�scsu�dkrd�n�dkr*d�n�dkrGd�|jD�S�s^d�|jD�S�fd�|jD�S(	s�

        The user may have requested help on a topic, return a dict of which
        topics to display. @chosen_topic has prescan_for_flag's return type

        :returns: dict

        RRR$RR)cSsi|]}|dk|�qS(scertbot-route53:auth((Rmtt((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pys
<dictcomp>�s	cSsi|]}t|�qS((R^(RmR�((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pys
<dictcomp>�s	csi|]}|�k|�qS(((RmR�(tchosen_topic(sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pys
<dictcomp>�s	(RJ(R`R�((R�sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pyRU�s		((t__name__t
__module__t__doc__R^RfRHRzRTR�R�R�R�RMRNR�R�R�R�R�RU(((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pyR-s"I		"		<		"			-			(-R�t
__future__RR�R�R�R�RERYRRtzope.componentR;tzope.interfaceRRAtacme.magic_typingRRR1RRRtcertbot.compatRR8RR	tcertbot.displayRCtcertbot._internal.cliR
RRR
RRRRRRRRRtobjectR(((sA/usr/lib/python2.7/site-packages/certbot/_internal/cli/helpful.pyt<module>s,X

Spamworldpro Mini