Sindbad~EG File Manager
3
+ĜgH� � @ sT 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
dlm Z d
dlm!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-m0Z0 d
d l-m1Z1 d
d!l-m2Z2 d
d"l-m3Z3 ej4�r�d dl5Z6d
d#l7m8Z8 ej9d$ej:d%ej;f d&�Z<ej9d'�Z=d(e>ej?ej@e>d)f d*�d+d,�ZAdOd.e>d)eBdd/�d0d1�ZCejDe= eEejFej@e=d%f d2�d3d4�ZGe
dPd(ejHd5 ej?d d6�d7d8��ZIejJd5 ejJd5 ejFd5 d9�d:d;�ZKG d<d=� d=e jL�ZMG d>d(� d(�ZNG d?d@� d@�ZOG dAd)� d)eO�ZPG dBd.� d.eP�ZQG dCdD� dDeQ�ZRG dEdF� dFeQ�ZSej;ej?ej; dG�dHdI�ZTG dJd5� d5�ZUG dKdL� dLeU�ZVG dMdN� dNeU�ZWdS )Q� N)�abc)�contextmanager)� ExitStack)�partial)�update_wrapper)�gettext)�ngettext)�repeat� )�types)�_verify_python_env)�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.)Zbound�V�Context�Command)�ctx�
incomplete�returnc c sV t jt| j�}xB|j| �D ]4}|j|�r|j| |�}|dk r|j r||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) Zmulti�namer. � r4 �+/tmp/pip-build-fsllo_ck/click/click/core.py�_complete_visible_commands1 s
r6 Fr- )�base_command�cmd_name�cmd�registerr* c C sl | j st|t� rd S |r"d}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- �RuntimeErrorr3 �type�__name__)r7 r8 r9 r: Zhintr4 r4 r5 �_check_multicommandD s r@ )�iterable�
batch_sizer* c C s t ttt| �|�� �S )N)�list�zipr �iter)rA rB r4 r4 r5 �batch\ s rF � Parameter)r( �paramr* c c s� y
dV W n~ t k
rV } z0|jdkr,| |_|dk rD|jdkrD||_� W Y dd}~X n4 tk
r� } z|jdkrv| |_� W Y dd}~X nX dS )z>Context manager that attaches extra information to exceptions.N)r r( rH r )r( rH �er4 r4 r5 �augment_usage_errors` s
rJ )�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.
rG )�itemr* c s8 y� j | �}W n tk
r* td�}Y nX | j |fS )N�inf)�index�
ValueError�float�is_eager)rM �idx)rK r4 r5 �sort_key| s
z,iter_params_for_processing.<locals>.sort_key)�key)r+ �Tuple�boolrQ �sorted)rK rL rT r4 )rK r5 �iter_params_for_processings s rY c @ s8 e Zd ZdZej� Zej� Zej� Zej� Z ej� 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�PROMPTr4 r4 r4 r5 rZ � s rZ c @ s e Zd ZU dZeZejd dNdejd eje ejej
eje ejeje ej
f eje eje e
eje
eje
eje
ejeje ejeje ge f eje
eje
dd�dd�Zeje ej
f d �d
d�Zd d �dd
�Zdd� ZedOe
ejd d�dd��Zeeje ej
f d �dd��Zed �dd�Zeje ed�dd�Zejdej
f ejdej
f d�dd�Zdd �dd �Zee d �d!d"��Zd d �d#d$�Z eje eje d%�d&d'�Z!eje ed%�d(d)�Z"ej#dPe d*ejej
d+�d,d-��Z$ej#dQe d.ejej%ej
ejg ej
f f d+�d/d-��Z$dRe e
ejej
d+�d0d-�Z$e d1d2�d3d4�Z&d1d �d5d6�Z'dSed1d8�d9d:�Z(e d �d;d<�Z)e d �d=d>�Z*dd d?�d@dA�Z+ej%dejdej
f f ej
ej
ej
dB�dCdD�Z,dej
ej
ej
dE�dFdG�Z-e e.ddH�dIdJ�Z/e eje. dK�dLdM�Z0dS )Tr&