%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/click/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/click/__pycache__/decorators.cpython-312.pyc

�

D�dI���ddlZddlZddlZddlmZddlmZddlm	Z	ddlm
Z
ddlmZddlmZdd	lm
Z
dd
lmZddlmZddlmZej&rddlZej,d
�Zej0d�Zej0d�Zej6dej8fZej0dej<ee
f��Zd@d�Z dAd�Z!	dBdejDede#dej6dgdffd�Z$dd�de%dejLe%ddfd �Z'ej0d!e
��Z(ejRd"ede
fd#��Z*ejRd"ejLe%d$ejDe(d%ej8dej6ege(ffd&��Z*ejR	dCd"dd$ejDe(d%ej8dej6ege(ffd'��Z*ejR	dDd"ejLe%d$dd%ej8dej6ege
ffd(��Z*		dEd"ej<ejLe%efd$ejLejDe(d%ej8dej<e
ej6egej<e
e(ffffd)�Z*ej0d*e��Z+ejRd"edefd+��Z,ejRd"ejLe%d$ejDe+d%ej8dej6ege+ffd,��Z,ejR	dCd"dd$ejDe+d%ej8dej6ege+ffd-��Z,ejR	dDd"ejLe%d$dd%ej8dej6egeffd.��Z,		dEd"ej<e%edfd$ejLejDe+d%ej8dej<eej6egej<ee+ffffd/�Z,dej6dej8fd0eddfd1�Z-dd2�d3e%d$ejLejDe	d%ej8dej6egeffd4�Z.dd2�d3e%d$ejLejDe
d%ej8dej6egeffd5�Z/d3e%d6ej8dej6egeffd7�Z0d3e%d6ej8dej6egeffd8�Z1	dCdddd9�d:ejLe%d3e%d;ejLe%d<ejLe%d=ejLe%d6ej8dej6egeffd>�Z2d3e%d6ej8dej6egeffd?�Z3y)F�N��update_wrapper)�gettext�)�Argument)�Command)�Context)�Group)�Option)�	Parameter��get_current_context)�echo�P�R�T.�FC)�bound�f�return�t.Callable[P, R]c�(��d�fd�}t|��S)z]Marks a callback as wanting to receive the current context
    object as first argument.
    c�,���t�g|��i|��S�Nr
��args�kwargsrs  ��2/usr/lib/python3/dist-packages/click/decorators.py�new_funczpass_context.<locals>.new_func s����$�&�8��8��8�8��r�P.argsr�P.kwargsrrr�rrs` r�pass_contextr%s���
9��(�A�&�&r c�(��d�fd�}t|��S)z�Similar to :func:`pass_context`, but only pass the object on the
    context onwards (:attr:`Context.obj`).  This is useful if that object
    represents the state of a nested system.
    c�@���t�jg|��i|��Sr)r�objrs  �rrzpass_obj.<locals>.new_func,s"����$�&�*�*�<�T�<�V�<�<r r!rr$s` r�pass_objr)&s���=��(�A�&�&r �object_type�ensure�#t.Callable[te.Concatenate[T, P], R]c����d��fd�}|S)a.Given an object type this creates a decorator that will work
    similar to :func:`pass_obj` but instead of passing the object of the
    current context, it will find the innermost context of type
    :func:`object_type`.

    This generates a decorator that works roughly like this::

        from functools import update_wrapper

        def decorator(f):
            @pass_context
            def new_func(ctx, *args, **kwargs):
                obj = ctx.find_object(object_type)
                return ctx.invoke(f, obj, *args, **kwargs)
            return update_wrapper(new_func, f)
        return decorator

    :param object_type: the type of the object to pass.
    :param ensure: if set to `True`, a new object will be created and
                   remembered on the context if it's not there yet.
    c�.���d���fd�}t|��S)Nc����t�}�r|j��}n|j��}|�td�j�d���|j
�|g|��i|��S)Nz<Managed to invoke callback without a context object of type z
 existing.)r�
ensure_object�find_object�RuntimeError�__name__�invoke)rr�ctxr(r+rr*s    ���rrz8make_pass_decorator.<locals>.decorator.<locals>.new_funcLsx���%�'�C���'�'��4���o�o�k�2���{�"�'�'2�';�';�&>� �!����3�:�:�a��6�t�6�v�6�6r r!r)rrr+r*s` ��r�	decoratorz&make_pass_decorator.<locals>.decoratorKs���	7�$�h��*�*r )rr,rr�)r*r+r6s`` r�make_pass_decoratorr82s���2+�*�r )�doc_description�keyr9zGt.Callable[[t.Callable[te.Concatenate[t.Any, P], R]], t.Callable[P, R]]c�:��d�fd�}|�d��d�}d|�d�|_|S)a{Create a decorator that passes a key from
    :attr:`click.Context.meta` as the first argument to the decorated
    function.

    :param key: Key in ``Context.meta`` to pass.
    :param doc_description: Description of the object being passed,
        inserted into the decorator's docstring. Defaults to "the 'key'
        key from Context.meta".

    .. versionadded:: 8.0
    c�@���dddddtf��fd�}t|��S)Nrr"rr#rc�d��t�}|j�}|j�|g|��i|��Sr)r�metar4)rrr5r(rr:s    ��rrz2pass_meta_key.<locals>.decorator.<locals>.new_funcss5���%�'�C��(�(�3�-�C��3�:�:�a��6�t�6�v�6�6r )rr)rrr:s` �rr6z pass_meta_key.<locals>.decoratorrs,���	7�H�	7�
�	7�q�	7�
�h��*�*r zthe z$ key from :attr:`click.Context.meta`zDecorator that passes z1 as the first argument to the decorated function.�rz't.Callable[te.Concatenate[t.Any, P], R]rr)�__doc__)r:r9r6s`  r�
pass_meta_keyrAcsC���+��� ���'K�L��!�� 1�2&�	&����r �CmdType�namec��yrr7�rCs r�commandrF����r �cls�attrsc��yrr7�rCrHrIs   rrFrF����r c��yrr7rKs   rrFrF����r c��yrr7rKs   rrFrF����r c������d}t��r�}d���Jd���rJd����/tjtjtt
��dtdtf���fd�}|�||�S|S)a�Creates a new :class:`Command` and uses the decorated function as
    callback.  This will also automatically attach all decorated
    :func:`option`\s and :func:`argument`\s as parameters to the command.

    The name of the command defaults to the name of the function with
    underscores replaced by dashes.  If you want to change that, you can
    pass the intended name as the first argument.

    All keyword arguments are forwarded to the underlying command class.
    For the ``params`` argument, any decorated params are appended to
    the end of the list.

    Once decorated the function turns into a :class:`Command` instance
    that can be invoked as a command line utility or be attached to a
    command :class:`Group`.

    :param name: the name of the command.  This defaults to the function
                 name with underscores replaced by dashes.
    :param cls: the command class to instantiate.  This defaults to
                :class:`Command`.

    .. versionchanged:: 8.1
        This decorator can be applied without parentheses.

    .. versionchanged:: 8.1
        The ``params`` argument can be used. Decorated params are
        appended to the end of the list.
    Nz4Use 'command(cls=cls)(callable)' to specify a class.z7Use 'command(**kwargs)(callable)' to provide arguments.rrc����t|t�rtd���jdd�}|�|ng}	|j}|`|jt
|���jd��|j�d<tjr��J�t��rJ��d�xs*|jj�jdd�||d����}|j|_	|S#t$rY��wxYw)Nz5Attempted to convert a callback into a command twice.�params�help�_�-)rC�callbackrSr7)�
isinstancer�	TypeError�pop�__click_params__�extend�reversed�AttributeError�getr@�t�
TYPE_CHECKING�callabler3�lower�replace)r�attr_paramsrS�decorator_params�cmdrIrHrCs     ���rr6zcommand.<locals>.decorator�s����a��!��S�T�T��i�i��$�/�� +� 7��R��	6� �1�1���"��M�M�(�#3�4�5��9�9�V��$��I�I�E�&�M��?�?��?�"�?���~�%�%��
��=����)�)�+�3�3�C��=���
��	
���i�i����
��)�	��	�s�C*�*	C6�5C6)rbr`�cast�TyperBr�_AnyCallable)rCrHrI�funcr6s```  rrFrF�s����D;?�D���~������{�R�R�R�{��S�S�S�y�
�{��f�f�Q�V�V�G�_�g�.���\��g��>�������r �GrpTypec��yrr7rEs r�grouprnrGr c��yrr7rKs   rrnrnrLr c��yrr7rKs   rrnrnrNr c��yrr7rKs   rrnrnrPr c��|�/tjtjtt�}t|�rt
dd|i|��|�St
||fi|��S)aCreates a new :class:`Group` with a function as callback.  This
    works otherwise the same as :func:`command` just that the `cls`
    parameter is set to :class:`Group`.

    .. versionchanged:: 8.1
        This decorator can be applied without parentheses.
    rHr7)r`rhrirlr
rbrFrKs   rrnrn$sT���{��f�f�Q�V�V�G�_�e�,����~�(�w�(�3�(�%�(��.�.��4��&��&�&r �paramc��t|t�r|jj|�yt	|d�sg|_|j
j|�y)Nr[)rXrrS�append�hasattrr[)rrss  r�_param_memorw9sC���!�W��	��������q�,�-�!#�A��	���!�!�%�(r )rH�param_declsc�D������t�dtdtf���fd�}|S)a�Attaches an argument to the command.  All positional arguments are
    passed as parameter declarations to :class:`Argument`; all keyword
    arguments are forwarded unchanged (except ``cls``).
    This is equivalent to creating an :class:`Argument` instance manually
    and attaching it to the :attr:`Command.params` list.

    For the default argument class, refer to :class:`Argument` and
    :class:`Parameter` for descriptions of parameters.

    :param cls: the argument class to instantiate.  This defaults to
                :class:`Argument`.
    :param param_decls: Passed as positional arguments to the constructor of
        ``cls``.
    :param attrs: Passed as keyword arguments to the constructor of ``cls``.
    rrc�.��t|��fi����|Sr�rw�rrIrHrxs ���rr6zargument.<locals>.decoratorX�����A�s�;�0�%�0�1��r )rr�rHrxrIr6s``` r�argumentrCs*���$�{����R��B���r c�D������t�dtdtf���fd�}|S)a�Attaches an option to the command.  All positional arguments are
    passed as parameter declarations to :class:`Option`; all keyword
    arguments are forwarded unchanged (except ``cls``).
    This is equivalent to creating an :class:`Option` instance manually
    and attaching it to the :attr:`Command.params` list.

    For the default option class, refer to :class:`Option` and
    :class:`Parameter` for descriptions of parameters.

    :param cls: the option class to instantiate.  This defaults to
                :class:`Option`.
    :param param_decls: Passed as positional arguments to the constructor of
        ``cls``.
    :param attrs: Passed as keyword arguments to the constructor of ``cls``.
    rrc�.��t|��fi����|Srr{r|s ���rr6zoption.<locals>.decoratortr}r )rrr~s``` r�optionr�_s*���$�{����R��B���r rc��dtdtdtddfd�}|sd}|jdd	�|jd
|�|jdd�|jd
d�|jdd�t	|i|��S)a-Add a ``--yes`` option which shows a prompt before continuing if
    not passed. If the prompt is declined, the program will exit.

    :param param_decls: One or more option names. Defaults to the single
        value ``"--yes"``.
    :param kwargs: Extra arguments are passed to :func:`option`.
    r5rs�valuerNc�*�|s|j�yyr)�abort�r5rsr�s   rrWz%confirmation_option.<locals>.callback�s����I�I�K�r )z--yes�is_flagTrW�expose_valueF�promptzDo you want to continue?rTz%Confirm the action without prompting.)r	r�bool�
setdefaultr��rxrrWs   r�confirmation_optionr�{s����g��i������� ��
���i��&�
���j�(�+�
���n�e�,�
���h� :�;�
���f�E�F��;�)�&�)�)r c��|sd}|jdd�|jdd�|jdd�t|i|��S)a0Add a ``--password`` option which prompts for a password, hiding
    input and asking to enter the value again for confirmation.

    :param param_decls: One or more option names. Defaults to the single
        value ``"--password"``.
    :param kwargs: Extra arguments are passed to :func:`option`.
    )z
--passwordr�T�confirmation_prompt�
hide_input)r�r�)rxrs  r�password_optionr��sM���%��
���h��%�
���+�T�2�
���l�D�)��;�)�&�)�)r )�package_name�	prog_name�message�versionr�r�r�c��������td����v��ttj�}|�|jnd}|�|jnd}~|�=|jd���dk(r|jd���r�j
d�d�dtd	td
tddf����fd�}	|sd
}|jdd�|jdd�|jdd�|jdtd��|	|d<t|i|��S)a�Add a ``--version`` option which immediately prints the version
    number and exits the program.

    If ``version`` is not provided, Click will try to detect it using
    :func:`importlib.metadata.version` to get the version for the
    ``package_name``. On Python < 3.8, the ``importlib_metadata``
    backport must be installed.

    If ``package_name`` is not provided, Click will try to detect it by
    inspecting the stack frames. This will be used to detect the
    version, so it must match the name of the installed package.

    :param version: The version number to show. If not provided, Click
        will try to detect it.
    :param param_decls: One or more option names. Defaults to the single
        value ``"--version"``.
    :param package_name: The package name to detect the version from. If
        not provided, Click will try to detect it.
    :param prog_name: The name of the CLI to show in the message. If not
        provided, it will be detected from the command.
    :param message: The message to show. The values ``%(prog)s``,
        ``%(package)s``, and ``%(version)s`` are available. Defaults to
        ``"%(prog)s, version %(version)s"``.
    :param kwargs: Extra arguments are passed to :func:`option`.
    :raise RuntimeError: ``version`` could not be detected.

    .. versionchanged:: 8.0
        Add the ``package_name`` parameter, and the ``%(package)s``
        value for messages.

    .. versionchanged:: 8.0
        Use :mod:`importlib.metadata` instead of ``pkg_resources``. The
        version is detected based on the package name, not the entry
        point name. The Python package name must match the installed
        package name, or be passed with ``package_name=``.
    Nz%(prog)s, version %(version)sr3�__main__�__package__�.rr5rsr�rc�~��|r|jry��|j�j�����	ddlm}	|j�����td��d���t����d�z|j��|j�y#t
$rddl}Y�awxYw#|j$rt��d��d�wxYw)Nr)�metadataz6 is not installed. Try passing 'package_name' instead.z$Could not determine the version for z automatically.)�prog�packager���color)
�resilient_parsing�	find_root�	info_name�	importlibr��ImportError�importlib_metadatar��PackageNotFoundErrorr2rr��exit)r5rsr�r�r�r�r�r�s    ����rrWz version_option.<locals>.callback�s������-�-��
���
�
��1�1�I��?�|�7�
6�.�

�"�*�*�<�8���?��6�|�6F�o�V��
�	
��y�\�g�V�V��)�)�	
�	���
��+�
6�5�
6���0�0�
�"�#�&�'/�/����
�s�B
�B�

B�B�B<)z	--versionr�Tr�F�is_eagerrTzShow the version and exit.rW)rU�inspect�currentframe�f_back�	f_globalsr_�	partitionr	rr�r�r�)
r�r�r�r�rxr�framer�r�rWs
````      r�version_optionr��s(���X���3�4����<�/��$�$�&��!&�!2������(.�(:�F�$�$��	�
�� �$�=�=��4�L��z�)�(�}�}�]�;���+�5�5�c�:�1�=��$�g�$�i�$��$��$�$�L�$��
���i��&�
���n�e�,�
���j�$�'�
���f�a� <�=�>�!�F�:���;�)�&�)�)r c��dtdtdtddfd�}|sd}|jdd	�|jd
d�|jdd	�|jd
t	d��||d<t|i|��S)a�Add a ``--help`` option which immediately prints the help page
    and exits the program.

    This is usually unnecessary, as the ``--help`` option is added to
    each command automatically unless ``add_help_option=False`` is
    passed.

    :param param_decls: One or more option names. Defaults to the single
        value ``"--help"``.
    :param kwargs: Extra arguments are passed to :func:`option`.
    r5rsr�rNc��|r|jryt|j�|j��|j	�y)Nr�)r�r�get_helpr�r�r�s   rrWzhelp_option.<locals>.callback"s-����-�-���S�\�\�^�3�9�9�-����
r )z--helpr�Tr�Fr�rTzShow this message and exit.rW)r	rr�r�rUr�r�s   r�help_optionr�s����g��i�������!��
���i��&�
���n�e�,�
���j�$�'�
���f�a� =�>�?�!�F�:���;�)�&�)�)r )rz)t.Callable[te.Concatenate[Context, P], R]rrr?)Fr).N)NN)4r��types�typingr`�	functoolsrrrU�corerrr	r
rr�globalsr�utilsrra�typing_extensions�te�	ParamSpecr�TypeVarrr�Callable�Anyrj�Unionrr%r)rir�r8�str�OptionalrArB�overloadrFrlrnrwrr�r�r�r�r�r7r r�<module>r�s������$� �������(���?�?�"�����S��A�
�A�I�I�c�N��
�A�I�I�c�N���z�z�#�q�u�u�*�%���Q�Y�Y�t�1�7�7�<��#8�9�:��'�	'�,1�.������.�$(�.��Z�Z�6�7�9K�K�L�.�d59��	��"#�*�*�S�/��N��B�!�)�)�I�W�
-������,��7��������
�*�*�S�/��	
�������U�U���Z�Z����'�(�	��������
��
�������U�U�	�
�Z�Z����'�(�������-1��
�*�*�S�/��&*��<=�E�E���Z�Z����'�(����48�'+�O�
�'�'�!�*�*�S�/�<�/�
0�O�	
���A�F�F�7�O�	$�O��U�U�O��W�W�W�a�j�j�,������'�9I�1J�!J�K�
K�L�	O�d�!�)�)�I�U�
+����������������
�*�*�S�/��	
�������U�U���Z�Z����'�(�	��������
��
�������U�U�	�
�Z�Z����'�(�������-1��
�*�*�S�/��&*��<=�E�E���Z�Z����%�&����.2�'+�'�
�'�'�#�|�T�)�
*�'�	
���A�F�F�7�O�	$�'��U�U�'��W�W�U�A�J�J��~�q�w�w�u�g�~�/F�F�G�
G�H�	'�*)�1�:�:�c�1�5�5�j�)�)�)�)��)�<@�����J�J�q�v�v�h�'7�8��JK�%�%���Z�Z���b����::>�����J�J�q�v�v�f�~�6��HI�����Z�Z���b����8*�c�*�Q�U�U�*�q�z�z�2�$�PR�(�?S�*�0*�#�*����*�1�:�:�r�d�B�h�;O�*�$ $�n*�%)�!%�#�n*�
�Z�Z��_�n*��n*��*�*�S�/�n*��z�z�#��	n*�
�Z�Z��_�n*��e�e�
n*��Z�Z���b���n*�b*�c�*�Q�U�U�*�q�z�z�2�$��(�7K�*r 

Zerion Mini Shell 1.0