File: //opt/alt/python37/lib/python3.7/site-packages/click/__pycache__/core.cpython-37.pyc
B
�P�e�� � @ sH d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dl m
Z
d dl mZ d dlm
Z
d dlmZ d dlmZ d dlmZ d d lmZ d
dlmZ d
dlmZ d
d
lmZ d
dlmZ d
dlmZ d
dlmZ d
dlmZ d
dlmZ d
dlmZ d
dl m!Z! d
dl m"Z" d
dl#m$Z$ d
dl#m%Z% d
dl#m&Z& d
dl'm(Z( d
dl'm)Z) d
dl'm*Z* d
dl+m,Z, d
dl+m-Z- d
dl+m.Z. d
dl+m/Z/ d
d l+m0Z0 d
d!l+m1Z1 ej2�r�d dl3Z4d
d"l5m6Z6 ej7d#ej8d$ej9f d%�Z:e�7d&�Z;d'e<ej=ej>e<d(f d)�d*d+�Z?dNd-e<d(e@dd.�d/d0�ZAejBe; eCejDej>e;d$f d1�d2d3�ZEe
dOd'ejFd4 ej=d d5�d6d7��ZGejHd4 ejHd4 ejDd4 d8�d9d:�ZIG d;d<� d<e jJ�ZKG d=d'� d'�ZLG d>d?� d?�ZMG d@d(� d(eM�ZNG dAd-� d-eN�ZOG dBdC� dCeO�ZPG dDdE� dEeO�ZQej9ej=ej9 dF�dGdH�ZRG dId4� d4�ZSG dJdK� dKeS�ZTG dLdM� dMeS�ZUdS )P� N)�abc)�contextmanager)� ExitStack)�update_wrapper)�gettext)�ngettext)�repeat)�
TracebackType� )�types)�Abort)�BadParameter)�ClickException)�Exit)�MissingParameter)�
UsageError)�
HelpFormatter)�join_options)�pop_context)�push_context)�_flag_needs_value)�OptionParser)� split_opt)�confirm)�prompt)�style)�_detect_program_name)�_expand_args)�echo)�make_default_short_help)�make_str)�PacifyFlushWrapper)�CompletionItem�F.)�bound�V�Context�Command)�ctx�
incomplete�returnc c sT t �t| j�}x@|�| �D ]2}|�|�r|�| |�}|dk r|js||fV qW dS )z�List all the subcommands of a group that start with the
incomplete value and aren't hidden.
:param ctx: Invocation context for the group.
:param incomplete: Value being completed. May be empty.
N)�t�cast�MultiCommand�command�
list_commands�
startswith�get_command�hidden)r( r) �multi�namer. � r5 �;/opt/alt/python37/lib/python3.7/site-packages/click/core.py�_complete_visible_commands0 s
r7 Fr- )�base_command�cmd_name�cmd�registerr* c C sh | j rt|t�sd S |rd}nd}t|� d| j�d|�d|�dt|�j� dt| �j� d| j�d ���d S )
NzdIt is not possible to add multi commands as children to another multi command that is in chain mode.zdFound a multi command as subcommand to a multi command that is in chain mode. This is not supported.z
. Command z is set to chain and zA was added as a subcommand but it in itself is a multi command. (z is a z within a chained z named z).)�chain�
isinstancer- �RuntimeErrorr4 �type�__name__)r8 r9 r: r; �hintr5 r5 r6 �_check_multicommandC s rB )�iterable�
batch_sizer* c C s t ttt| �|�� �S )N)�list�zipr �iter)rC rD r5 r5 r6 �batch[ s rH � Parameter)r( �paramr* c
c s� y
dV W n~ t k
rV } z.|jdkr,| |_|dk rD|jdkrD||_� W dd}~X Y n4 tk
r� } z|jdkrv| |_� W dd}~X Y nX dS )z>Context manager that attaches extra information to exceptions.N)r
r( rJ r )r( rJ �er5 r5 r6 �augment_usage_errors_ s
rL )�invocation_order�declaration_orderr* c s* dt jttf d�� fdd�}t||d�S )z�Given a sequence of parameters in the order as should be considered
for processing and an iterable of parameters that exist, this returns
a list in the correct order as they should be processed.
rI )�itemr* c s8 y� � | �}W n tk
r* td�}Y nX | j |fS )N�inf)�index�
ValueError�float�is_eager)rO �idx)rM r5 r6 �sort_key{ s
z,iter_params_for_processing.<locals>.sort_key)�key)r+ �Tuple�boolrS �sorted)rM rN rV r5 )rM r6 �iter_params_for_processingr s r[ c @ s8 e Zd ZdZe�� Ze�� Ze�� Ze�� Z e�� Z
dS )�ParameterSourcea\ This is an :class:`~enum.Enum` that indicates the source of a
parameter's value.
Use :meth:`click.Context.get_parameter_source` to get the
source for a parameter by name.
.. versionchanged:: 8.0
Use :class:`~enum.Enum` and drop the ``validate`` method.
.. versionchanged:: 8.0
Added the ``PROMPT`` value.
N)r@ �
__module__�__qualname__�__doc__�enum�auto�COMMANDLINE�ENVIRONMENT�DEFAULT�DEFAULT_MAP�PROMPTr5 r5 r5 r6 r\ � s r\ c @ s~ e Zd ZU dZeZejd ed<