[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.146.206.19: ~ $


��W�<�@s�dZddlZddlmZddlmZmZmZmZdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
Gdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZdS)aq
    click.parser
    ~~~~~~~~~~~~

    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.
�N)�deque�)�
UsageError�NoSuchOption�BadOptionUsage�BadArgumentUsagecsht���t|�}g}d��fdd��x�|r�|�}|dkrm|j����q9|dkr���fdd�t|�D�}�dk	r�|j�|jt|��q9|dkr9�dk	r�td��t|��|jd�q9W�dk	rRt��|�<g�t|�dd��|�dd�<t|�t��fS)	a�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`.
    NcsAy$�dkr|j�S|j�SWntk
r<dSYnXdS)N)�popleft�pop�
IndexError)�c)�spos��
/parser.py�_fetch's

z_unpack_args.<locals>._fetchrcsg|]}����qSr
r
)�.0�_)r�argsr
r�
<listcomp>5s	z _unpack_args.<locals>.<listcomp>rzCannot have two nargs < 0)	r�append�range�reverse�tuple�	TypeError�len�reversed�list)rZ
nargs_spec�rv�nargs�xr
)rrrr�_unpack_argss0
		"
(rcCs6|dkrtd|��td||f��dS)Nrz%s option requires an argumentz%s option requires %d arguments)r)r�optr
r
r�_error_opt_argsKsr!cCsn|dd�}|j�r&d|fS|dd�|krZ|dd�|dd�fS||dd�fS)Nr��)�isalnum)r �firstr
r
r�	split_optQs
r&cCsB|dks|jdkr|St|�\}}||j|�S)N)Ztoken_normalize_funcr&)r �ctx�prefixr
r
r�
normalize_optZsr)cCs�g}x�tjd|tj�D]�}|j�j�}|dd�|dd�kr�|dd�dkr�|dd	�jdd�jd�}yt|�|�}Wntk
r�YnX|j	|�qW|S)
zDGiven an argument string this attempts to split it into small parts.z>('([^'\\]*(?:\\.[^'\\]*)*)'|"([^"\\]*(?:\\.[^"\\]*)*)"|\S+)\s*Nrz"'�ascii�backslashreplacezunicode-escape���r,)
�re�finditer�S�group�strip�encode�decode�type�UnicodeErrorr)�stringr�match�argr
r
r�split_arg_stringas6	
r9c@sFeZdZdddddd�Zedd��Zdd�ZdS)	�OptionNrc
Csg|_g|_t�|_x�|D]�}t|�\}}	|sStd|��|jj|d�t|�dkr�t|	�dkr�|jj|�q%|jj|�|jj|�q%W|dkr�d}||_	||_
||_||_||_
dS)Nz'Invalid start character for option (%s)rr�store)�_short_opts�
_long_opts�set�prefixesr&�
ValueError�addrr�dest�actionr�const�obj)
�self�optsrBrCrrDrEr r(�valuer
r
r�__init__us(		

$				zOption.__init__cCs
|jdkS)Nr;r)zstorezappend)rC)rFr
r
r�takes_value�szOption.takes_valuecCs|jdkr"||j|j<n�|jdkrG|j|j|j<n�|jdkrx|jj|jg�j|�n|jdkr�|jj|jg�j|j�nK|jdkr�|jj|jd�d|j|j<ntd|j��|jj|j	�dS)	Nr;�store_constrZappend_const�countrrzunknown action %r)
rCrGrBrD�
setdefaultr�getr@�orderrE)rFrH�stater
r
r�process�s"%)zOption.process)�__name__�
__module__�__qualname__rI�propertyrJrQr
r
r
rr:ssr:c@s.eZdZdddd�Zdd�ZdS)�ArgumentrNcCs||_||_||_dS)N)rBrrE)rFrBrrEr
r
rrI�s		zArgument.__init__cCs�|jdkrktdd�|D��}|t|�krCd}n(|dkrktd|j|jf��||j|j<|jj|j�dS)Nrcss!|]}|dkrdVqdS)Nrr
)rrr
r
r�	<genexpr>�sz#Argument.process.<locals>.<genexpr>rzargument %s takes %d values)	r�sumrrrBrGrOrrE)rFrHrPZholesr
r
rrQ�s	zArgument.process)rRrSrTrIrQr
r
r
rrV�srVc@seZdZdd�ZdS)�ParsingStatecCs(i|_g|_||_g|_dS)N)rG�largs�rargsrO)rFr[r
r
rrI�s			zParsingState.__init__N)rRrSrTrIr
r
r
rrY�srYc@s�eZdZdZddd�Zdddddd�Zdddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�ZdS)�OptionParsera+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.
    NcCss||_d|_d|_|dk	r?|j|_|j|_i|_i|_tddg�|_g|_dS)NTF�-z--)r'�allow_interspersed_args�ignore_unknown_options�
_short_opt�	_long_optr>�
_opt_prefixes�_args)rFr'r
r
rrI�s					zOptionParser.__init__rc	s�|dkr|}�fdd�|D�}t||d|d|d|d|�}�jj|j�x|jD]}|�j|<qoWx|jD]}|�j|<q�WdS)ayAdds 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.
        Ncs"g|]}t|�j��qSr
)r)r')rr )rFr
rr�s	z+OptionParser.add_option.<locals>.<listcomp>rCrrDrE)r:rb�updater?r<r`r=ra)	rFrGrBrCrrDrE�optionr r
)rFr�
add_option�s
zOptionParser.add_optioncCs;|dkr|}|jjtd|d|d|��dS)z�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.
        NrBrrE)rcrrV)rFrBrrEr
r
r�add_argument�szOptionParser.add_argumentcCstt|�}y|j|�|j|�Wn1tk
r]|jdksV|jjrY�YnX|j|j|jfS)aZParses 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)	rY�_process_args_for_options�_process_args_for_argsrr'Zresilient_parsingrGrZrO)rFrrPr
r
r�
parse_argss

zOptionParser.parse_argscCsyt|j|jdd�|jD��\}}x1t|j�D] \}}|j|||�q?W||_g|_dS)NcSsg|]}|j�qSr
)r)rrr
r
rrs	z7OptionParser._process_args_for_args.<locals>.<listcomp>)rrZr[rc�	enumeraterQ)rFrPZpargsr�idxr8r
r
rris	z#OptionParser._process_args_for_argscCs�x�|jr�|jjd�}t|�}|dkr:dS|dd�|jkrr|dkrr|j||�q|jr�|jj|�q|jjd|�dSqWdS)Nrz--r)	r[r	rrb�
_process_optsr^rZr�insert)rFrPr8Zarglenr
r
rrhs%	z&OptionParser._process_args_for_optionscs&�|jkr=�fdd�|jD�}t�d|��|j�}|jr�|dk	rr|jjd|�|j}t|j�|kr�t|��q|dkr�|jjd�}qt	|jd|��}|jd|�=n%|dk	rt
d���nd}|j||�dS)Ncs%g|]}|j��r|�qSr
)�
startswith)rZword)r r
rrBs	z0OptionParser._match_long_opt.<locals>.<listcomp>�
possibilitiesrrz%s option does not take a value)rarrJr[rnrrr!r	rrrQ)rFr �explicit_valuerPrprerrHr
)r r�_match_long_opt@s$
		zOptionParser._match_long_optcCs�d}d}|d}g}xK|dd�D]9}t|||j�}|jj|�}	|d7}|	s�|jr�|j|�q-t|��|	jrI|t|�kr�|j	j
d||d��d}|	j}
t|j	�|
kr�t|
|�qO|
dkr|j	j
d�}qOt|j	d|
��}|j	d|
�=nd}|	j||�|r-Pq-W|jr�|r�|jj|dj|��dS)NFrrTr")r)r'r`rNr_rrrJrr[rnrr!r	rrQrZ�join)rFr8rP�stop�ir(Zunknown_optionsZchr rerrHr
r
r�_match_short_opt`s<

	
		zOptionParser._match_short_optcCs�d}d|kr-|jdd�\}}n|}t||j�}y|j|||�WnWtk
r�|dd�|jkr�|j||�S|js��|jj	|�YnXdS)N�=rr#)
�splitr)r'rrrrbrvr_rZr)rFr8rPrqZlong_optZ
norm_long_optr
r
rrm�s
	zOptionParser._process_opts)
rRrSrT�__doc__rIrfrgrjrirhrrrvrmr
r
r
rr\�s	

$ /r\)ryr-�collectionsr�
exceptionsrrrrrr!r&r)r9�objectr:rVrYr\r
r
r
r�<module>s"3	0	

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.opt-1.pyc File 2.8 KB 0644
__init__.cpython-35.pyc File 2.8 KB 0644
_bashcomplete.cpython-35.opt-1.pyc File 2.45 KB 0644
_bashcomplete.cpython-35.pyc File 2.45 KB 0644
_compat.cpython-35.opt-1.pyc File 16.31 KB 0644
_compat.cpython-35.pyc File 16.31 KB 0644
_termui_impl.cpython-35.opt-1.pyc File 14.07 KB 0644
_termui_impl.cpython-35.pyc File 14.07 KB 0644
_textwrap.cpython-35.opt-1.pyc File 1.33 KB 0644
_textwrap.cpython-35.pyc File 1.33 KB 0644
_unicodefun.cpython-35.opt-1.pyc File 3.37 KB 0644
_unicodefun.cpython-35.pyc File 3.37 KB 0644
_winconsole.cpython-35.opt-1.pyc File 7.9 KB 0644
_winconsole.cpython-35.pyc File 7.9 KB 0644
core.cpython-35.opt-1.pyc File 57.77 KB 0644
core.cpython-35.pyc File 58.27 KB 0644
decorators.cpython-35.opt-1.pyc File 11.7 KB 0644
decorators.cpython-35.pyc File 11.7 KB 0644
exceptions.cpython-35.opt-1.pyc File 7.97 KB 0644
exceptions.cpython-35.pyc File 7.97 KB 0644
formatting.cpython-35.opt-1.pyc File 8.81 KB 0644
formatting.cpython-35.pyc File 8.81 KB 0644
globals.cpython-35.opt-1.pyc File 1.82 KB 0644
globals.cpython-35.pyc File 1.82 KB 0644
parser.cpython-35.opt-1.pyc File 12.19 KB 0644
parser.cpython-35.pyc File 12.19 KB 0644
termui.cpython-35.opt-1.pyc File 19.07 KB 0644
termui.cpython-35.pyc File 19.07 KB 0644
testing.cpython-35.opt-1.pyc File 10.59 KB 0644
testing.cpython-35.pyc File 10.59 KB 0644
types.cpython-35.opt-1.pyc File 18.07 KB 0644
types.cpython-35.pyc File 18.23 KB 0644
utils.cpython-35.opt-1.pyc File 14.36 KB 0644
utils.cpython-35.pyc File 14.36 KB 0644