HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //usr/local/lib/python3.9/site-packages/click/__pycache__/exceptions.cpython-39.pyc
a

X>h�%�@sJddlZddlmZddlmZddlmZddlmZddl	m
Z
ddl	mZejrzdd	l
mZdd
l
mZddl
mZejejejeefejed�d
d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�Z Gd!d"�d"e�Z!dS)#�N)�gettext)�ngettext�)�get_text_stderr)�resolve_color_default)�echo)�format_filename)�Command)�Context)�	Parameter)�
param_hint�returncCs*|dur&t|t�s&d�dd�|D��S|S)Nz / css|]}t|�VqdS�N)�repr)�.0�x�r�:/usr/local/lib/python3.9/site-packages/click/exceptions.py�	<genexpr>�z$_join_param_hints.<locals>.<genexpr>)�
isinstance�str�join)rrrr�_join_param_hintssrcsheZdZdZdZedd��fdd�Zed�dd	�Zed�d
d�Zde	j
e	je	jdd�d
d�Z
�ZS)�ClickExceptionz8An exception that Click can handle and show to the user.rN)�messager
cst��|�t�|_||_dSr)�super�__init__r�
show_colorr)�selfr��	__class__rrrszClickException.__init__�r
cCs|jSr�r�rrrr�format_message&szClickException.format_messagecCs|jSrr#r$rrr�__str__)szClickException.__str__��filer
cCs2|durt�}ttd�j|��d�||jd�dS)N�Error: {message}r#�r(�color)rr�_�formatr%r)rr(rrr�show,s�zClickException.show)N)�__name__�
__module__�__qualname__�__doc__�	exit_coderrr%r&�t�Optional�IO�Anyr.�
__classcell__rrr rrsrcsVeZdZdZdZdeejddd��fdd�
Zdejej	ej
dd�d	d
�Z�ZS)
�
UsageErrora+An internal exception that signals a usage error.  This typically
    aborts any further handling.

    :param message: the error message to display.
    :param ctx: optionally the context that caused this error.  Click will
                fill in the context automatically in some situations.
    �Nr
)r�ctxr
cs*t��|�||_|jr |jjnd|_dSr)rrr;�command�cmd)rrr;r rrrBszUsageError.__init__r'cCs�|durt�}d}d}|jdur\|jj�|j�dur\td�j|jj|jjdd�}|�d�}|jdur�|jj}t	|j�
��d|��||d�t	td�j|��d�||d�dS)	N�z"Try '{command} {option}' for help.r)r<�option�
r*r)r#)rr;r<Zget_help_optionr,r-Zcommand_pathZhelp_option_namesr+r�	get_usager%)rr(r+�hintrrrr.Gs(���

�zUsageError.show)N)N)
r/r0r1r2r3rr4r5rr6r7r.r8rrr rr97sr9csPeZdZdZdeejdejdejedd��fdd�
Zed�d	d
�Z�Z	S)�BadParametera
An exception that formats out a standardized error message for a
    bad parameter.  This is useful when thrown from a callback or type as
    Click will attach contextual information to it (for instance, which
    parameter it is).

    .. versionadded:: 2.0

    :param param: the parameter object that caused this error.  This can
                  be left out, and Click will attach this info itself
                  if possible.
    :param param_hint: a string that shows up as parameter name.  This
                       can be used as alternative to `param` in cases
                       where custom validation should happen.  If it is
                       a string it's used as such, if it's a list then
                       each item is quoted and separated.
    Nr
r)rr;�paramrr
cst��||�||_||_dSr)rrrDr)rrr;rDrr rrrpszBadParameter.__init__r"cCsV|jdur|j}n,|jdur,|j�|j�}ntd�j|jd�Std�jt|�|jd�S)NzInvalid value: {message}r#z)Invalid value for {param_hint}: {message})rr)rrD�get_error_hintr;r,r-rr)rrrrrr%{s


�zBadParameter.format_message)NNN�
r/r0r1r2rr4r5rr%r8rrr rrC^s��rCcsleZdZdZd
ejeejdejdejeejedd��fdd�
Zed�d	d
�Zed�dd�Z	�Z
S)�MissingParametera�Raised if click required an option or argument but it was not
    provided when invoking the script.

    .. versionadded:: 4.0

    :param param_type: a string that indicates the type of the parameter.
                       The default is to inherit the parameter type from
                       the given `param`.  Valid values are ``'parameter'``,
                       ``'option'`` or ``'argument'``.
    Nr
r)rr;rDr�
param_typer
cs t��|pd|||�||_dS)Nr>)rrrH)rrr;rDrrHr rrr�szMissingParameter.__init__r"cCs|jdur|j}n|jdur,|j�|j�}nd}t|�}|rFd|��nd}|j}|durj|jdurj|jj}|j}|jdur�|jj�	|j�}|r�|r�|d|��7}n|}|r�d|��nd}|dkr�t
d�}n4|dkr�t
d�}n"|dkr�t
d	�}nt
d
�j|d�}|�|�d|��S)
N� r>z. �argumentzMissing argumentr?zMissing optionZ	parameterzMissing parameterzMissing {param_type})rH�.)rrDrEr;rrHZparam_type_namer�typeZget_missing_messager,r-)rrrH�msgZ	msg_extra�missingrrrr%�s4





zMissingParameter.format_messagecCs2|js(|jr|jjnd}td�j|d�S|jSdS)NzMissing parameter: {param_name})�
param_name)rrD�namer,r-)rrOrrrr&�szMissingParameter.__str__)NNNNN)r/r0r1r2r4r5rrr%r&r8rrr rrG�s 
��&rGcsVeZdZdZd
eejeejejeejddd��fdd�
Zed�dd	�Z	�Z
S)�NoSuchOptionzfRaised if click attempted to handle an option that does not
    exist.

    .. versionadded:: 4.0
    Nr
)�option_namer�
possibilitiesr;r
cs6|durtd�j|d�}t��||�||_||_dS)NzNo such option: {name})rP)r,r-rrrRrS)rrRrrSr;r rrr�s
zNoSuchOption.__init__r"cCsH|js|jSd�t|j��}tddt|j��j||d�}|j�d|��S)Nz, zDid you mean {possibility}?z#(Possible options: {possibilities}))ZpossibilityrSrI)rSrr�sortedr�lenr-)rZpossibility_strZsuggestrrrr%�s��zNoSuchOption.format_message)NNN)r/r0r1r2rr4r5�Sequencerr%r8rrr rrQ�s	��rQcs4eZdZdZdeeejddd��fdd�
Z�ZS)�BadOptionUsageaRaised if an option is generally supplied but the use of the option
    was incorrect.  This is for instance raised if the number of arguments
    for an option is not correct.

    .. versionadded:: 4.0

    :param option_name: the name of the option being used incorrectly.
    Nr
)rRrr;r
cst��||�||_dSr)rrrR)rrRrr;r rrr�szBadOptionUsage.__init__)N)	r/r0r1r2rr4r5rr8rrr rrW�s
��rWc@seZdZdZdS)�BadArgumentUsagez�Raised if an argument is generally supplied but the use of the argument
    was incorrect.  This is for instance raised if the number of values
    for an argument is not correct.

    .. versionadded:: 6.0
    N�r/r0r1r2rrrrrXsrXcs@eZdZdZd	eejedd��fdd�
Zed�dd�Z�Z	S)
�	FileErrorz"Raised if a file cannot be opened.N)�filenamerBr
cs0|durtd�}t��|�t|�|_||_dS)Nz
unknown error)r,rrr�ui_filenamer[)rr[rBr rrrs

zFileError.__init__r"cCstd�j|j|jd�S)Nz+Could not open file {filename!r}: {message})r[r)r,r-r\rr$rrrr%s�zFileError.format_message)NrFrrr rrZ	srZc@seZdZdZdS)�Abortz=An internal signalling exception that signals Click to abort.NrYrrrrr]sr]c@s&eZdZdZdZdedd�dd�ZdS)	�Exitz�An exception that indicates that the application should exit with some
    status code.

    :param code: the status code to exit with.
    �r3rN)�coder
cCs
||_dSrr_)rr`rrrr'sz
Exit.__init__)r)r/r0r1r2�	__slots__�intrrrrrr^sr^)"�typingr4rr,rZ_compatr�globalsr�utilsrr�
TYPE_CHECKING�corer	r
rr5�UnionrVrr�	Exceptionrr9rCrGrQrWrXrZ�RuntimeErrorr]r^rrrr�<module>s.�	'*E"