zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
U
ß=®d9$ã@s>ddlZddlmZddlmZddlmZddlmZddlm    Z    ej
rnddl m Z dd    l m Z dd
l mZejejejeefejed œd d „ZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGd d!„d!eƒZdS)"éN)Úgettext)Úngettexté)Úget_text_stderr)Úecho)Úformat_filename)ÚCommand)ÚContext)Ú    Parameter)Ú
param_hintÚreturncCs*|dk    r&t|tƒs&d dd„|Dƒ¡S|S)Nz / css|]}t|ƒVqdS©N)Úrepr)Ú.0Úx©rúGd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\click/exceptions.pyÚ    <genexpr>sz$_join_param_hints.<locals>.<genexpr>)Ú
isinstanceÚstrÚjoin)r rrrÚ_join_param_hintssrcsheZdZdZdZeddœ‡fdd„ Zedœdd    „Zedœd
d „Zde    j
e    j e    j dd œd d„Z ‡ZS)ÚClickExceptionz8An exception that Click can handle and show to the user.rN)Úmessager cstƒ |¡||_dSr )ÚsuperÚ__init__r)Úselfr©Ú    __class__rrrs zClickException.__init__©r cCs|jSr ©r©rrrrÚformat_message"szClickException.format_messagecCs|jSr r r!rrrÚ__str__%szClickException.__str__©Úfiler cCs.|dkrtƒ}ttdƒj| ¡d|ddS)NúError: {message}r )r%)rrÚ_Úformatr")rr%rrrÚshow(szClickException.show)N)Ú__name__Ú
__module__Ú __qualname__Ú__doc__Ú    exit_coderrr"r#ÚtÚOptionalÚIOÚAnyr)Ú __classcell__rrrrrs rcsVeZdZdZdZd eejdddœ‡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 )rrr6ÚcommandÚcmd)rrr6rrrr:s zUsageError.__init__r$cCs®|dkrtƒ}d}d}|jdk    r\|jj |j¡dk    r\tdƒj|jj|jjdd}|›d}|jdk    rŒ|jj}t    |j 
¡›d|›||dt    tdƒj|  ¡d||ddS)    NÚz"Try '{command} {option}' for help.r)r7ÚoptionÚ
)r%Úcolorr&r ) rr6r7Zget_help_optionr'r(Z command_pathZhelp_option_namesr<rÚ    get_usager")rr%r<Úhintrrrr)?s*ÿþ
ÿ
 
ýzUsageError.show)N)N) r*r+r,r-r.rr/r0rr1r2r)r3rrrrr4/sr4csPeZdZdZd eejdejdejeddœ‡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
)rr6Úparamr r cstƒ ||¡||_||_dSr )rrr@r )rrr6r@r rrrrhszBadParameter.__init__rcCsV|jdk    r|j}n,|jdk    r,|j |j¡}ntdƒj|jdStdƒjt|ƒ|jdS)NzInvalid value: {message}r z)Invalid value for {param_hint}: {message})r r)r r@Úget_error_hintr6r'r(rr)rr rrrr"ss
 
ÿzBadParameter.format_message)NNN©
r*r+r,r-rr/r0rr"r3rrrrr?Vsûú r?csleZdZdZd ejeejdejdejeejeddœ‡fdd„ Zedœd    d
„Zedœd d „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
)rr6r@r Ú
param_typer cs tƒ |p d|||¡||_dS)Nr9)rrrD)rrr6r@r rDrrrrŒszMissingParameter.__init__rcCs|jdk    r|j}n|jdk    r,|j |j¡}nd}t|ƒ}|rFd|›nd}|j}|dkrj|jdk    rj|jj}|j}|jdk    r¦|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ú r9z. ZargumentzMissing argumentr:zMissing optionZ    parameterzMissing parameterzMissing {param_type})rDÚ.) r r@rAr6rrDZparam_type_namerÚtypeZget_missing_messager'r()rr rDÚmsgZ    msg_extraÚmissingrrrr"—s4
 
 
 
 
 
zMissingParameter.format_messagecCs2|js(|jr|jjnd}tdƒj|dS|jSdS)NzMissing parameter: {param_name})Ú
param_name)rr@Únamer'r()rrJrrrr#½szMissingParameter.__str__)NNNNN) r*r+r,r-r/r0rrr"r#r3rrrrrC€s  úù &rCcsVeZdZdZd
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Ú possibilitiesr6r cs6|dkrtdƒj|d}tƒ ||¡||_||_dS)NzNo such option: {name})rK)r'r(rrrMrN)rrMrrNr6rrrrÌs
zNoSuchOption.__init__rcCsH|js |jSd t|jƒ¡}tddt|jƒƒj||d}|j›d|›S)Nz, zDid you mean {possibility}?z#(Possible options: {possibilities}))Z possibilityrNrE)rNrrÚsortedrÚlenr()rZpossibility_strZsuggestrrrr"ÚsýüzNoSuchOption.format_message)NNN) r*r+r,r-rr/r0ÚSequencerr"r3rrrrrLÅs    ûúrLcs4eZdZdZdeeejdddœ‡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    )rMrr6r cstƒ ||¡||_dSr )rrrM)rrMrr6rrrrñszBadOptionUsage.__init__)N)    r*r+r,r-rr/r0rr3rrrrrRçs
ÿþrRc@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*r+r,r-rrrrrSøsrScs@eZdZdZd    eejeddœ‡fdd„ Zedœdd„Z‡Z    S)
Ú    FileErrorz"Raised if a file cannot be opened.N)Úfilenamer>r cs0|dkrtdƒ}tƒ |¡t|ƒ|_||_dS)Nz unknown error)r'rrrÚ ui_filenamerV)rrVr>rrrrs
 
zFileError.__init__rcCstdƒj|j|jdS)Nz+Could not open file {filename!r}: {message})rVr)r'r(rWrr!rrrr" sÿzFileError.format_message)NrBrrrrrUsrUc@seZdZdZdS)ÚAbortz=An internal signalling exception that signals Click to abort.NrTrrrrrXsrXc@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.
    ©r.rN)Úcoder cCs
||_dSr rZ)rr[rrrrsz Exit.__init__)r)r*r+r,r-Ú    __slots__ÚintrrrrrrYsrY) Útypingr/rr'rÚ_compatrÚutilsrrÚ TYPE_CHECKINGÚcorerr    r
r0ÚUnionrQrrÚ    Exceptionrr4r?rCrLrRrSrUÚ RuntimeErrorrXrYrrrrÚ<module>s,        þ     '*E"