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/cli_utils.pyc
�
���_c@s�dZddlZddlZddlZddlmZddlmZddlm	Z	ddlm
Z
ddlmZddl
mZd	efd
��YZdd�Zd
�Zed�Zdefd��YZdejfd��YZdejfd��YZd�Zdefd��YZd�Zdejfd��YZd�Zdejfd��YZ dejfd��YZ!d ejfd!��YZ"d"�Z#dS(#s"Certbot command line util functioni����N(t
challenges(t
interfaces(tutil(terrors(tos(t	constantst_DefaultcBs2eZdZd�Zd�Zd�Zd�ZRS(sAA class to use as a default to detect if a value is set by a usercCstS(N(tFalse(tself((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyt__bool__scCs
t|t�S(N(t
isinstanceR(Rtother((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyt__eq__scCs
tt�S(N(tidR(R((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyt__hash__scCs
|j�S(N(R	(R((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyt__nonzero__s(t__name__t
__module__t__doc__R	RRR(((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyRs
			trbcCspyDtjj|�}t||��}|j�}WdQX||fSWn%tk
rk}tj|j��nXdS(sReturns the given file's contents.

    :param str filename: path to file
    :param str mode: open mode (see `open`)

    :returns: absolute path of filename and its contents
    :rtype: tuple

    :raises argparse.ArgumentTypeError: File does not exist or is not readable.

    N(	RtpathtabspathtopentreadtIOErrortargparsetArgumentTypeErrortstrerror(tfilenametmodetthe_filetcontentstexc((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyt	read_filescCstjtj|�S(sDefault value for CLI flag.(tcopytdeepcopyRtCLI_DEFAULTS(tname((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pytflag_default4scCs&|r
tjStjj|�}|jS(s5Extract the help message for an `.IConfig` attribute.(RtSUPPRESSRtIConfigt__getitem__R(R%thiddentfield((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pytconfig_help=stHelpfulArgumentGroupcBs eZdZd�Zd�ZRS(s+Emulates an argparse group for use with HelpfulArgumentParser.

    This class is used in the add_group method of HelpfulArgumentParser.
    Command line arguments can be added to the group, but help
    suppression and default detection is applied by
    HelpfulArgumentParser when necessary.

    cCs||_||_dS(N(t_parsert_topic(Rthelpful_arg_parserttopic((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyt__init__Ns	cOs|jj|j||�dS(s6Add a new command line argument to the argument group.N(R.taddR/(Rtargstkwargs((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pytadd_argumentRs(RRRR2R6(((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyR-Es	tCustomHelpFormattercBseZdZd�ZRS(s�This is a clone of ArgumentDefaultsHelpFormatter, with bugfixes.

    In particular we fix https://bugs.python.org/issue28742
    cCsz|j}d|jkrvd|jkrv|jtjkrvtjtjg}|jsc|j|krs|d7}qsqvn|S(Ns
%(default)s	(default:s (default: %(default)s)(thelptdefaultRR'tOPTIONALtZERO_OR_MOREtoption_stringstnargs(Rtactionthelpstrtdefaulting_nargs((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyt_get_help_string]s	(RRRRA(((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyR7Wst_DomainsActioncBseZdZdd�ZRS(s!Action class for parsing domains.cCst||�dS(s%Just wrap add_domains in argparseese.N(tadd_domains(Rtparsert	namespacetdomaint
option_string((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyt__call__jsN(RRRtNoneRH(((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyRBgscCshg}x[|jd�D]J}tj|j��}|j|�||jkr|jj|�qqW|S(s�Registers new domains to be used during the current client run.

    Domains are not added to the list of requested domains if they have
    already been registered.

    :param args_or_config: parsed command line arguments
    :type args_or_config: argparse.Namespace or
        configuration.NamespaceConfig
    :param str domain: one or more comma separated domains

    :returns: domains after they have been normalized and validated
    :rtype: `list` of `str`

    t,(tsplitRtenforce_domain_sanitytstriptappendtdomains(targs_or_configROtvalidated_domainsRF((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyRCos
tCaseInsensitiveListcBseZdZd�ZRS(sA list that will ignore case when searching.

    This class is passed to the `choices` argument of `argparse.add_arguments`
    through the `helpful` wrapper. It is necessary due to special handling of
    command line arguments by `set_by_cli` in which the `type_func` is not applied.cCstt|�j|j��S(N(tsuperRRt__contains__tlower(Rtelement((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyRT�s(RRRRT(((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyRR�scCs.d|ksd|kr*tjd��n|S(Nt(t)smay not contain parentheses(RR(tvalue((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyt_user_agent_comment_type�st_EncodeReasonActioncBseZdZdd�ZRS(s+Action class for parsing revocation reason.cCs*tj|j�}t||j|�dS(s.Encodes the reason for certificate revocation.N(RtREVOCATION_REASONSRUtsetattrtdest(RRDREtreasonRGtcode((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyRH�sN(RRRRIRH(((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyR[�scCs�idd6dd6}g|D]}|j�^q}g|D]}|j||�^q:}djd�|D��}|r�tjdj|���n|S(s Translate and validate preferred challenges.

    :param pref_challs: list of preferred challenge types
    :type pref_challs: `list` of `str`

    :returns: validated list of preferred challenge types
    :rtype: `list` of `str`

    :raises errors.Error: if pref_challs is invalid

    sdns-01tdnsshttp-01thttps, css'|]}|tjjkr|VqdS(N(Rt	ChallengetTYPES(t.0R%((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pys	<genexpr>�ssUnrecognized challenges: {0}(RMtgettjoinRtErrortformat(tpref_challstaliasestctchallstunrecognized((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pytparse_preferred_challenges�s%t_PrefChallActioncBseZdZdd�ZRS(s.Action class for parsing preferred challenges.cCs^yt|jd��}Wn.tjk
rI}tj|t|���nX|jj|�dS(NRJ(	RoRKRRhRt
ArgumentErrortstrRjtextend(RRDRERjRGRmterror((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyRH�s
N(RRRRIRH(((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyRp�st_DeployHookActioncBseZdZdd�ZRS(s&Action class for parsing deploy hooks.cCsP|j|jk}|r<|j|kr<tj|d��n||_|_dS(Ns!conflicts with --renew-hook value(tdeploy_hookt
renew_hookRRq(RRDREtvaluesRGtrenew_hook_set((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyRH�s
N(RRRRIRH(((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyRu�st_RenewHookActioncBseZdZdd�ZRS(s%Action class for parsing renew hooks.cCsF|jdk	}|r9|j|kr9tj|d��n||_dS(Ns"conflicts with --deploy-hook value(RvRIRRqRw(RRDRERxRGtdeploy_hook_set((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyRH�s
N(RRRRIRH(((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyRz�scCsUyt|�}Wn tk
r2tjd��nX|dkrQtjd��n|S(s[Converts value to an int and checks that it is not negative.

    This function should used as the type parameter for argparse
    arguments.

    :param str value: value provided on the command line

    :returns: integer representation of value
    :rtype: int

    :raises argparse.ArgumentTypeError: if value isn't a non-negative integer

    svalue must be an integerisvalue must be non-negative(tintt
ValueErrorRR(RYt	int_value((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pytnonnegative_int�s
($RRR"tzope.interface.interfacetzopetacmeRtcertbotRRRtcertbot.compatRtcertbot._internalRtobjectRR!R&RR,R-t
HelpFormatterR7tActionRBRCtlistRRRZR[RoRpRuRzR(((sC/usr/lib/python2.7/site-packages/certbot/_internal/cli/cli_utils.pyt<module>s2			
			

Spamworldpro Mini