HEX
Server: LiteSpeed
System: Linux pl-rocket-da1.hostsila.org 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: etorby24eu (1588)
PHP: 8.3.23
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //lib/python2.7/site-packages/click/types.pyc
�
o�Dac@snddlZddlZddlmZddlmZddlmZddlmZddlmZddlmZdd	lm	Z	dd
lm
Z
ddlmZddl
mZdd
l
mZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZd efd!��YZd"efd#��YZd$efd%��YZd&efd'��YZd(efd)��YZd*efd+��YZd,efd-��YZ dd.�Z"e�Z#e�Z$e�Z%e�Z&e�Z'e�Z(dS(/i����N(tdatetimei(t_get_argv_encoding(tfilename_to_ui(tget_filesystem_encoding(t
get_streerror(topen_stream(tPY2(t	text_type(tBadParameter(tLazyFile(tsafecallt	ParamTypecBsbeZdZeZdZdZddd�Zd�Z	d�Z
d�Zd�Zddd�Z
RS(s�Helper for converting values through types.  The following is
    necessary for a valid type:

    *   it needs a name
    *   it needs to pass through None unchanged
    *   it needs to convert from a string
    *   it needs to convert its result type through unchanged
        (eg: needs to be idempotent)
    *   it needs to be able to deal with param and context being `None`.
        This can be the case when the object is used with prompt
        inputs.
    cCs#|dk	r|j|||�SdS(N(tNonetconvert(tselftvaluetparamtctx((s*/tmp/pip-build-W6Gm0N/click/click/types.pyt__call__,scCsdS(s>Returns the metavar default for this param if it provides one.N((RR((s*/tmp/pip-build-W6Gm0N/click/click/types.pytget_metavar0tcCsdS(stOptionally might return extra information about a missing
        parameter.

        .. versionadded:: 2.0
        N((RR((s*/tmp/pip-build-W6Gm0N/click/click/types.pytget_missing_message3RcCs|S(siConverts the value.  This is not invoked for values that are
        `None` (the missing value).
        ((RRRR((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR
:scCs|p	dj|j�S(suGiven a value from an environment variable this splits it up
        into small chunks depending on the defined envvar list splitter.

        If the splitter is set to `None`, which means that whitespace splits,
        then leading and trailing whitespace is ignored.  Otherwise, leading
        and trailing splitters usually lead to empty items being included.
        R(tsplittenvvar_list_splitter(Rtrv((s*/tmp/pip-build-W6Gm0N/click/click/types.pytsplit_envvar_value@scCst|d|d|��dS(s4Helper method to fail with an invalid value message.RRN(R(RtmessageRR((s*/tmp/pip-build-W6Gm0N/click/click/types.pytfailJsN(t__name__t
__module__t__doc__tFalsetis_compositeRtnameRRRRR
RR(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyRs				
tCompositeParamTypecBseZeZed��ZRS(cCs
t��dS(N(tNotImplementedError(R((s*/tmp/pip-build-W6Gm0N/click/click/types.pytarityRs(RRtTrueR tpropertyR$(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR"Ost
FuncParamTypecBseZd�Zd�ZRS(cCs|j|_||_dS(N(RR!tfunc(RR(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyt__init__XscCsxy|j|�SWn`tk
rsyt|�}Wn)tk
r\t|�jdd�}nX|j|||�nXdS(Nsutf-8treplace(R(t
ValueErrorRtUnicodeErrortstrtdecodeR(RRRR((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR
\s

(RRR)R
(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR'Ws	tUnprocessedParamTypecBs eZdZd�Zd�ZRS(ttextcCs|S(N((RRRR((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR
jscCsdS(NtUNPROCESSED((R((s*/tmp/pip-build-W6Gm0N/click/click/types.pyt__repr__ms(RRR!R
R2(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR/gs	tStringParamTypecBs eZdZd�Zd�ZRS(R0cCs�t|t�r�t�}y|j|�}Wnttk
r�t�}||kr�y|j|�}Wq�tk
r�|jdd�}q�Xq�|jdd�}nX|S|S(Nsutf-8R*(t
isinstancetbytesRR.R,R(RRRRtenctfs_enc((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR
ts	
	
cCsdS(NtSTRING((R((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR2�s(RRR!R
R2(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR3qs	tChoicecBsDeZdZdZed�Zd�Zd�Zd�Zd�Z	RS(s>The choice type allows a value to be checked against a fixed set
    of supported values. All of these values have to be strings.

    You should only pass a list or tuple of choices. Other iterables
    (like generators) may lead to surprising results.

    The resulting value will always be one of the originally passed choices
    regardless of ``case_sensitive`` or any ``ctx.token_normalize_func``
    being specified.

    See :ref:`choice-opts` for an example.

    :param case_sensitive: Set to false to make choices case
        insensitive. Defaults to true.
    tchoicecCs||_||_dS(N(tchoicestcase_sensitive(RR;R<((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR)�s	cCsdjdj|j��S(Ns[{}]t|(tformattjoinR;(RR((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR�scCsdjdj|j��S(NsChoose from:
	{}.s,
	(R>R?R;(RR((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR�scs�|}d�|jD�}�dk	rb�jdk	rb�j|�}�fd�|j�D�}n|js�tr}tj�n	tj��|�}�fd�|j�D�}n||kr�||S|j	dj
|dj|j��|��dS(NcSsi|]}||�qS(((t.0R:((s*/tmp/pip-build-W6Gm0N/click/click/types.pys
<dictcomp>�s	cs(i|]\}}|�j|��qS((ttoken_normalize_func(R@t
normed_choicetoriginal(R(s*/tmp/pip-build-W6Gm0N/click/click/types.pys
<dictcomp>�s	cs%i|]\}}|�|��qS(((R@RBRC(tlower(s*/tmp/pip-build-W6Gm0N/click/click/types.pys
<dictcomp>�s	s$invalid choice: {}. (choose from {})s, (R;RRAtitemsR<RR-RDtcasefoldRR>R?(RRRRtnormed_valuetnormed_choices((RRDs*/tmp/pip-build-W6Gm0N/click/click/types.pyR
�s(		cCsdjt|j��S(NsChoice('{}')(R>tlistR;(R((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR2�s(
RRRR!R%R)RRR
R2(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR9�s			&tDateTimecBsDeZdZdZdd�Zd�Zd�Zd�Zd�Z	RS(sKThe DateTime type converts date strings into `datetime` objects.

    The format strings which are checked are configurable, but default to some
    common (non-timezone aware) ISO 8601 formats.

    When specifying *DateTime* formats, you should only pass a list or a tuple.
    Other iterables, like generators, may lead to surprising results.

    The format strings are processed using ``datetime.strptime``, and this
    consequently defines the format strings which are allowed.

    Parsing is tried using each format, in order, and the first format which
    parses successfully is used.

    :param formats: A list or tuple of date format strings, in the order in
                    which they should be tried. Defaults to
                    ``'%Y-%m-%d'``, ``'%Y-%m-%dT%H:%M:%S'``,
                    ``'%Y-%m-%d %H:%M:%S'``.
    RcCs|pdddg|_dS(Ns%Y-%m-%ds%Y-%m-%dT%H:%M:%Ss%Y-%m-%d %H:%M:%S(tformats(RRK((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR)�scCsdjdj|j��S(Ns[{}]R=(R>R?RK(RR((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR�scCs-ytj||�SWntk
r(dSXdS(N(RtstrptimeR+R(RRR>((s*/tmp/pip-build-W6Gm0N/click/click/types.pyt_try_to_convert_date�s
cCsYx-|jD]"}|j||�}|r
|Sq
W|jdj|dj|j���dS(Ns-invalid datetime format: {}. (choose from {})s, (RKRMRR>R?(RRRRR>tdtime((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR
�scCsdS(NRJ((R((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR2sN(
RRRR!RR)RRMR
R2(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyRJ�s			
tIntParamTypecBs eZdZd�Zd�ZRS(tintegercCsByt|�SWn-tk
r=|jdj|�||�nXdS(Ns{} is not a valid integer(tintR+RR>(RRRR((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR
s
cCsdS(NtINT((R((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR2
s(RRR!R
R2(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyROs	tIntRangecBs8eZdZdZdded�Zd�Zd�ZRS(sA parameter that works similar to :data:`click.INT` but restricts
    the value to fit into a range.  The default behavior is to fail if the
    value falls outside the range, but it can also be silently clamped
    between the two edges.

    See :ref:`ranges` for an example.
    s
integer rangecCs||_||_||_dS(N(tmintmaxtclamp(RRTRURV((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR)s		cCsAtj||||�}|jrn|jdk	rF||jkrF|jS|jdk	rn||jkrn|jSn|jdk	r�||jks�|jdk	r=||jkr=|jdkr�|jdj||j�||�q=|jdkr|jdj||j�||�q=|jdj||j|j�||�n|S(Ns-{} is bigger than the maximum valid value {}.s.{} is smaller than the minimum valid value {}.s){} is not in the valid range of {} to {}.(ROR
RVRTRRURR>(RRRRR((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR
!s8	



cCsdj|j|j�S(NsIntRange({}, {})(R>RTRU(R((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR2HsN(	RRRR!RRR)R
R2(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyRSs
	'tFloatParamTypecBs eZdZd�Zd�ZRS(tfloatcCsByt|�SWn-tk
r=|jdj|�||�nXdS(Ns&{} is not a valid floating point value(RXR+RR>(RRRR((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR
Os

cCsdS(NtFLOAT((R((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR2Ws(RRR!R
R2(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyRWLs	t
FloatRangecBs8eZdZdZdded�Zd�Zd�ZRS(sA parameter that works similar to :data:`click.FLOAT` but restricts
    the value to fit into a range.  The default behavior is to fail if the
    value falls outside the range, but it can also be silently clamped
    between the two edges.

    See :ref:`ranges` for an example.
    sfloat rangecCs||_||_||_dS(N(RTRURV(RRTRURV((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR)fs		cCsAtj||||�}|jrn|jdk	rF||jkrF|jS|jdk	rn||jkrn|jSn|jdk	r�||jks�|jdk	r=||jkr=|jdkr�|jdj||j�||�q=|jdkr|jdj||j�||�q=|jdj||j|j�||�n|S(Ns-{} is bigger than the maximum valid value {}.s.{} is smaller than the minimum valid value {}.s){} is not in the valid range of {} to {}.(RWR
RVRTRRURR>(RRRRR((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR
ks8	



cCsdj|j|j�S(NsFloatRange({}, {})(R>RTRU(R((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR2�sN(	RRRR!RRR)R
R2(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyRZ[s
	't
BoolParamTypecBs eZdZd�Zd�ZRS(tbooleancCset|t�rt|�S|j�}|dkr5tS|d
krEtS|jdj|�||�dS(Nttruettt1tyestytfalsetft0tnotns{} is not a valid boolean(R]R^R_R`Ra(RbRcRdReRf(R4tboolRDR%RRR>(RRRR((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR
�s
cCsdS(NtBOOL((R((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR2�s(RRR!R
R2(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR[�s	
tUUIDParameterTypecBs eZdZd�Zd�ZRS(tuuidcCsxddl}y8tr6t|t�r6|jd�}n|j|�SWn-tk
rs|jdj|�||�nXdS(Ni����tasciis{} is not a valid UUID value(	RjRR4RtencodetUUIDR+RR>(RRRRRj((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR
�s
cCsdS(NRm((R((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR2�s(RRR!R
R2(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyRi�s	
tFilecBsJeZdZdZejjZdddde	d�Z
d�Zd�ZRS(s�Declares a parameter to be a file for reading or writing.  The file
    is automatically closed once the context tears down (after the command
    finished working).

    Files can be opened for reading or writing.  The special value ``-``
    indicates stdin or stdout depending on the mode.

    By default, the file is opened for reading text data, but it can also be
    opened in binary mode or for writing.  The encoding parameter can be used
    to force a specific encoding.

    The `lazy` flag controls if the file should be opened immediately or upon
    first IO. The default is to be non-lazy for standard input and output
    streams as well as files opened for reading, `lazy` otherwise. When opening a
    file lazily for reading, it is still opened temporarily for validation, but
    will not be held open until first IO. lazy is mainly useful when opening
    for writing to avoid creating the file until it is needed.

    Starting with Click 2.0, files can also be opened atomically in which
    case all writes go into a separate file in the same folder and upon
    completion the file will be moved over to the original location.  This
    is useful if a file regularly read by other users is modified.

    See :ref:`file-args` for more information.
    tfilenametrtstrictcCs1||_||_||_||_||_dS(N(tmodetencodingterrorstlazytatomic(RRrRsRtRuRv((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR)�s
				cCs=|jdk	r|jS|dkr&tSd|jkr9tStS(Nt-tw(RuRRRrR%(RR((s*/tmp/pip-build-W6Gm0N/click/click/types.pytresolve_lazy_flag�scCsEy�t|d�s!t|d�r%|S|j|�}|r�t||j|j|jd|j�}|dk	r�|j|j	�n|St
||j|j|jd|j�\}}|dk	r�|r�|jt|j��q�|jt|j
��n|SWnDttfk
r@}|jdjt|�t|��||�nXdS(NtreadtwriteRvsCould not open file: {}: {}(thasattrRyR	RrRsRtRvRt
call_on_closetclose_intelligentlyRR
tclosetflushtIOErrortOSErrorRR>RR(RRRRRuRctshould_closete((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR
�s.$*N(
RRRR!tostpathtpathsepRRRR)RyR
(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyRn�s		tPathc	BsMeZdZejjZeeeeeeedd�Z
d�Zd�ZRS(s�The path type is similar to the :class:`File` type but it performs
    different checks.  First of all, instead of returning an open file
    handle it returns just the filename.  Secondly, it can perform various
    basic checks about what the file or directory should be.

    .. versionchanged:: 6.0
       `allow_dash` was added.

    :param exists: if set to true, the file or directory needs to exist for
                   this value to be valid.  If this is not required and a
                   file does indeed not exist, then all further checks are
                   silently skipped.
    :param file_okay: controls if a file is a possible value.
    :param dir_okay: controls if a directory is a possible value.
    :param writable: if true, a writable check is performed.
    :param readable: if true, a readable check is performed.
    :param resolve_path: if this is true, then the path is fully resolved
                         before the value is passed onwards.  This means
                         that it's absolute and symlinks are resolved.  It
                         will not expand a tilde-prefix, as this is
                         supposed to be done by the shell only.
    :param allow_dash: If this is set to `True`, a single dash to indicate
                       standard streams is permitted.
    :param path_type: optionally a string type that should be used to
                      represent the path.  The default is `None` which
                      means the return value will be either bytes or
                      unicode depending on what makes most sense given the
                      input data Click deals with.
    c		Cs�||_||_||_||_||_||_||_||_|jrp|jrpd|_d|_	n:|jr�|jr�d|_d|_	nd|_d|_	dS(NtfileRnt	directoryt	DirectoryR�R�(
texistst	file_okaytdir_okaytwritabletreadabletresolve_patht
allow_dashttypeR!t	path_type(	RR�R�R�R�R�R�R�R�((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR)0s 											cCs_|jdk	r[t||j�r[|jtkrF|jt��}q[|jt��}n|S(N(R�RR4RR.RRl(RR((s*/tmp/pip-build-W6Gm0N/click/click/types.pytcoerce_path_resultNs
"cCs�|}|jo!|jo!|dk}|s�|jrHtjj|�}nytj|�}WnOtk
r�|js�|j	|�S|j
dj|jt
|��||�nX|jr�tj|j�r�|j
dj|jt
|��||�n|jr;tj|j�r;|j
dj|jt
|��||�n|jr�tj|tj�r�|j
dj|jt
|��||�n|jr�tj|tj�r�|j
dj|jt
|��||�q�n|j	|�S(NRws{} '{}' does not exist.s{} '{}' is a file.s{} '{}' is a directory.s{} '{}' is not writable.s{} '{}' is not readable.(RwRw(R�R�R�R�R�trealpathtstatR�R�R�RR>R�RtS_ISREGtst_modeR�tS_ISDIRR�taccesstW_OKR�tR_OK(RRRRRtis_dashtst((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR
VsN	
	




N(
RRRR�R�R�RRR%RR)R�R
(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR�s	tTuplecBs>eZdZd�Zed��Zed��Zd�ZRS(sThe default behavior of Click is to apply a type on a value directly.
    This works well in most cases, except for when `nargs` is set to a fixed
    count and different types should be used for different items.  In this
    case the :class:`Tuple` type can be used.  This type can only be used
    if `nargs` is set to a fixed number.

    For more information see :ref:`tuple-type`.

    This can be selected by using a Python tuple literal as a type.

    :param types: a list of types that should be used for the tuple items.
    cCs&g|D]}t|�^q|_dS(N(tconvert_typettypes(RR�tty((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR)�scCs#djdjd�|jD���S(Ns<{}>t css|]}|jVqdS(N(R!(R@R�((s*/tmp/pip-build-W6Gm0N/click/click/types.pys	<genexpr>�s(R>R?R�(R((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR!�scCs
t|j�S(N(tlenR�(R((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR$�scsSt|�t|j�kr*td��nt��fd�t|j|�D��S(NsLIt would appear that nargs is set to conflict with the composite type arity.c3s'|]\}}||���VqdS(N((R@R�tx(RR(s*/tmp/pip-build-W6Gm0N/click/click/types.pys	<genexpr>�s(R�R�t	TypeErrorttupletzip(RRRR((RRs*/tmp/pip-build-W6Gm0N/click/click/types.pyR
�s(RRRR)R&R!R$R
(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR��s
	cCs8t}|dkrZ|dk	rZt|t�rEttt|��}nt|�}t}nt|t�rst|�St|t�r�|S|t	ks�|t
ks�|dkr�tS|tkr�t
S|tkr�|r�tS|tkr�tS|r�tSy+t|t�rtdj|���nWntk
r-nXt|�S(sQConverts a callable or python type into the most appropriate
    param type.
    s7Attempted to use an uninstantiated parameter type ({}).N(RRR4R�tmapR�R%R�RRR-R8RQRRRgRhRXRYt
issubclasstAssertionErrorR>R�R'(R�tdefaulttguessed_type((s*/tmp/pip-build-W6Gm0N/click/click/types.pyR��s6	
$
()R�R�Rt_compatRRRRRRRt
exceptionsRtutilsR	R
tobjectRR"R'R/R3R9RJRORSRWRZR[RiRnR�R�RR�R1R8RRRYRhRm(((s*/tmp/pip-build-W6Gm0N/click/click/types.pyt<module>sF>
G4
;;W"7