https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /proc/self/root/usr/lib/python2.7/site-packages/click/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/lib/python2.7/site-packages/click/parser.pyc
�
./�_c@s�dZddlZddlmZddlmZddlmZddlmZddlmZd	�Z	d
�Z
d�Zd�Zd
�Z
defd��YZdefd��YZdefd��YZdefd��YZdS(s;
This module started out as largely a copy paste from the stdlib's
optparse module with the features removed that we do not need from
optparse because we implement them in Click on a higher level (for
instance type handling, help formatting and a lot more).

The plan is to remove more and more from here over time.

The reason this is a different module and not optparse from the stdlib
is that there are differences in 2.x and 3.x about the error messages
generated and optparse in the stdlib uses gettext for no good reason
and might cause us issues.

Click uses parts of optparse written by Gregory P. Ward and maintained
by the Python Software Foundation. This is limited to code in parser.py.

Copyright 2001-2006 Gregory P. Ward. All rights reserved.
Copyright 2002-2006 Python Software Foundation. All rights reserved.
i����N(tdequei(tBadArgumentUsage(tBadOptionUsage(tNoSuchOption(t
UsageErrorcsht|�}t|�}g}d��fd�}x�|r||�}|dkrj|j||��q6|dkr�gt|�D]}||�^q�}�dk	r�|j�n|jt|��q6|dkr6�dk	r�td��nt|��|jd�q6q6W�dk	rRt|�|�<g}t|�d�|�d)nt|�t	|�fS(s�Given an iterable of arguments and an iterable of nargs specifications,
    it returns a tuple with all the unpacked arguments at the first index
    and all remaining arguments as the second.

    The nargs specification is the number of arguments that should be consumed
    or `-1` to indicate that this position should eat up all the remainders.

    Missing items are filled with `None`.
    cs=y$�dkr|j�S|j�SWntk
r8dSXdS(N(tNonetpoplefttpopt
IndexError(tc(tspos(s-/tmp/pip-install-sTXtzD/click/click/parser.pyt_fetch-s

iisCannot have two nargs < 0N(
RRtappendtrangetreversettuplet	TypeErrortlentreversedtlist(targst
nargs_spectrvRtnargst_tx((R
s-/tmp/pip-install-sTXtzD/click/click/parser.pyt_unpack_argss0
		%
cCsF|dkr't|dj|���nt|dj||���dS(Nis{} option requires an arguments{} option requires {} arguments(Rtformat(Rtopt((s-/tmp/pip-install-sTXtzD/click/click/parser.pyt_error_opt_argsQscCsS|d }|j�r d|fS|dd!|krE|d |dfS||dfS(Niti(tisalnum(Rtfirst((s-/tmp/pip-install-sTXtzD/click/click/parser.pyt	split_optWs

cCsB|dks|jdkr|St|�\}}||j|�S(N(Rttoken_normalize_funcR!(Rtctxtprefix((s-/tmp/pip-install-sTXtzD/click/click/parser.pyt
normalize_opt`scCs�g}x�tjd|tj�D]�}|j�j�}|d |dkr�|d dkr�|dd!jdd�jd�}nyt|�|�}Wntk
r�nX|j	|�qW|S(sDGiven an argument string this attempts to split it into small parts.sB('([^'\\]*(?:\\.[^'\\]*)*)'|\"([^\"\\]*(?:\\.[^\"\\]*)*)\"|\S+)\s*ii����s"'tasciitbackslashreplacesunicode-escape(
tretfinditertStgrouptstriptencodetdecodettypetUnicodeErrorR(tstringRtmatchtarg((s-/tmp/pip-install-sTXtzD/click/click/parser.pytsplit_arg_stringgs	$%
tOptioncBs5eZddddd�Zed��Zd�ZRS(ic
Csg|_g|_t�|_x�|D]�}t|�\}}	|s[tdj|���n|jj|d�t|�dkr�t|	�dkr�|jj	|�q%|jj	|�|jj|�q%W|dkr�d}n||_||_||_
||_||_dS(Ns'Invalid start character for option ({})iitstore(t_short_optst
_long_optstsettprefixesR!t
ValueErrorRtaddRRRtdesttactionRtconsttobj(
tselftoptsR=R>RR?R@RR$tvalue((s-/tmp/pip-install-sTXtzD/click/click/parser.pyt__init__{s&		
$					cCs
|jdkS(NR6R(sstoresappend(R>(RA((s-/tmp/pip-install-sTXtzD/click/click/parser.pyttakes_value�scCs|jdkr"||j|j<n�|jdkrG|j|j|j<n�|jdkrx|jj|jg�j|�n�|jdkr�|jj|jg�j|j�nP|jdkr�|jj|jd�d|j|j<ntdj|j���|j	j|j
�dS(	NR6tstore_constRtappend_consttcountiisunknown action '{}'(R>RBR=R?t
setdefaultRtgetR;RtorderR@(RARCtstate((s-/tmp/pip-install-sTXtzD/click/click/parser.pytprocess�s"%)N(t__name__t
__module__RRDtpropertyRERM(((s-/tmp/pip-install-sTXtzD/click/click/parser.pyR5zstArgumentcBs eZddd�Zd�ZRS(icCs||_||_||_dS(N(R=RR@(RAR=RR@((s-/tmp/pip-install-sTXtzD/click/click/parser.pyRD�s		cCs�|jdkrptd�|D��}|t|�kr@d}qp|dkrptdj|j|j���qpn||j|j<|jj	|j
�dS(Nicss!|]}|dkrdVqdS(iN(R(t.0R((s-/tmp/pip-install-sTXtzD/click/click/parser.pys	<genexpr>�sisargument {} takes {} values(RtsumRRRRR=RBRKRR@(RARCRLtholes((s-/tmp/pip-install-sTXtzD/click/click/parser.pyRM�s	!N(RNRORRDRM(((s-/tmp/pip-install-sTXtzD/click/click/parser.pyRQ�stParsingStatecBseZd�ZRS(cCs(i|_g|_||_g|_dS(N(RBtlargstrargsRK(RARW((s-/tmp/pip-install-sTXtzD/click/click/parser.pyRD�s			(RNRORD(((s-/tmp/pip-install-sTXtzD/click/click/parser.pyRU�stOptionParsercBsteZdZdd�Zddddd�Zddd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZRS(s+The option parser is an internal class that is ultimately used to
    parse options and arguments.  It's modelled after optparse and brings
    a similar but vastly simplified API.  It should generally not be used
    directly as the high level Click classes wrap it for you.

    It's not nearly as extensible as optparse or argparse as it does not
    implement features that are implemented on a higher level (such as
    types or defaults).

    :param ctx: optionally the :class:`~click.Context` where this parser
                should go with.
    cCsp||_t|_t|_|dk	rB|j|_|j|_ni|_i|_ddh|_g|_	dS(Nt-s--(
R#tTruetallow_interspersed_argstFalsetignore_unknown_optionsRt
_short_optt	_long_optt
_opt_prefixest_args(RAR#((s-/tmp/pip-install-sTXtzD/click/click/parser.pyRD�s					ic	Cs�|dkr|}ng|D]}t||j�^q}t||d|d|d|d|�}|jj|j�x|jD]}||j|<q~Wx|j	D]}||j
|<q�WdS(syAdds a new option named `dest` to the parser.  The destination
        is not inferred (unlike with optparse) and needs to be explicitly
        provided.  Action can be any of ``store``, ``store_const``,
        ``append``, ``appnd_const`` or ``count``.

        The `obj` can be used to identify the option in the order list
        that is returned from the parser.
        R>RR?R@N(RR%R#R5R`tupdateR:R7R^R8R_(	RARBR=R>RR?R@Rtoption((s-/tmp/pip-install-sTXtzD/click/click/parser.pyt
add_option�s		%'cCs>|dkr|}n|jjtd|d|d|��dS(s�Adds a positional argument named `dest` to the parser.

        The `obj` can be used to identify the option in the order list
        that is returned from the parser.
        R=RR@N(RRaRRQ(RAR=RR@((s-/tmp/pip-install-sTXtzD/click/click/parser.pytadd_argument�s	cCsvt|�}y|j|�|j|�Wn3tk
r_|jdksV|jjr`�q`nX|j|j|j	fS(sZParses positional arguments and returns ``(values, args, order)``
        for the parsed options and arguments as well as the leftover
        arguments if there are any.  The order is a list of objects as they
        appear on the command line.  If arguments appear multiple times they
        will be memorized multiple times as well.
        N(
RUt_process_args_for_optionst_process_args_for_argsRR#Rtresilient_parsingRBRVRK(RARRL((s-/tmp/pip-install-sTXtzD/click/click/parser.pyt
parse_argss


cCs�t|j|jg|jD]}|j^q�\}}x1t|j�D] \}}|j|||�qHW||_g|_dS(N(RRVRWRaRt	enumerateRM(RARLRtpargsRtidxR3((s-/tmp/pip-install-sTXtzD/click/click/parser.pyRgs5	cCs�x�|jr�|jjd�}t|�}|dkr:dS|d |jkrl|dkrl|j||�q|jr�|jj|�q|jjd|�dSqWdS(Nis--i(	RWRRR`t
_process_optsR[RVRtinsert(RARLR3targlen((s-/tmp/pip-install-sTXtzD/click/click/parser.pyRfs	c	Cs@||jkrXg|jD]}|j|�r|^q}t|d|d|j��n|j|}|jr�|dk	r�|jjd|�n|j}t	|j�|kr�t
||�q,|dkr�|jjd�}q,t|j| �}|j|4n-|dk	r&t
|dj|���nd}|j||�dS(Nt
possibilitiesR#iis{} option does not take a value(R_t
startswithRR#RERRWRnRRRRRRRRM(	RARtexplicit_valueRLtwordRpRcRRC((s-/tmp/pip-install-sTXtzD/click/click/parser.pyt_match_long_optCs$+
		
cCs�t}d}|d}g}xH|dD]<}t|||j�}|jj|�}	|d7}|	s�|jr�|j|�q'nt|d|j��n|	jrC|t	|�kr�|j
jd||�t}n|	j
}
t	|j
�|
krt|
|�qI|
dkr#|j
jd�}qIt|j
|
 �}|j
|
4nd}|	j||�|r'Pq'q'W|jr�|r�|jjdj|dj|���ndS(NiiR#s{}{}R(R\R%R#R^RJR]RRRERRWRnRZRRRRRRMRVRtjoin(RAR3RLtstoptiR$tunknown_optionstchRRcRRC((s-/tmp/pip-install-sTXtzD/click/click/parser.pyt_match_short_optbs<

	
			
cCs�d}d|kr-|jdd�\}}n|}t||j�}y|j|||�WnStk
r�|d |jkr�|j||�S|js��n|j	j
|�nXdS(Nt=ii(RtsplitR%R#RtRR`RzR]RVR(RAR3RLRrtlong_optt
norm_long_opt((s-/tmp/pip-install-sTXtzD/click/click/parser.pyRm�s
	N(
RNROt__doc__RRDRdReRiRgRfRtRzRm(((s-/tmp/pip-install-sTXtzD/click/click/parser.pyRX�s
			$		/(RR(tcollectionsRt
exceptionsRRRRRRR!R%R4tobjectR5RQRURX(((s-/tmp/pip-install-sTXtzD/click/click/parser.pyt<module>s	3					.

https://t.me/AnonymousX5 - 2025