4V=jV.ddlmZddlmZddlZddlmZddlm Z ddl m Z ddl m Z ddlmZdd lmZejrdd lmZdd lmZdd lmZd.dZd/dZGddeZGddeZGddeZGddeZGddeZGd d!eZGd"d#eZGd$d%eZ Gd&d'eZ!Gd(d)eZ"Gd*d+e#Z$Gd,d-e#Z%dS)0) annotationsN)gettext)ngettext)get_text_stderr)resolve_color_default)echo)format_filename)Command)Context) Parameter param_hintcabc.Sequence[str] | str | Nonereturn str | Nonecr|4t|tsdd|DS|S)Nz / c34K|]}t|VdSNrepr).0xs >C:\PYTHON\_runtimes\venv\Lib\site-packages\click/exceptions.py z$_join_param_hints..s(66a$q''666666) isinstancestrjoin)rs r_join_param_hintsrs>jS&A&Azz66:666666 r possibilities list[str]rcddt|D}tddt|||S)Nz, c34K|]}t|VdSrr)rps rrz(_format_possibilities..s(GGAQGGGGGGrzDid you mean {possibility}?z'(Did you mean one of: {possibilities}?)) possibilityr )rsortedrlenformat)r possibility_strs r_format_possibilitiesr*saiiGG 1F1FGGGGGO %1 M   ffHH IrcbeZdZUdZdZded<ded<ded<dfd Zdd ZddZdddZ xZ S)ClickExceptionz8An exception that Click can handle and show to the user.rt.ClassVar[int] exit_codezt.Final[bool | None] show_color t.Final[str]messagerrNonec~t|t|_||_dSr)super__init__rr/r1)selfr1 __class__s rr5zClickException.__init__,s5 !!!011 rc|jSrr1r6s rformat_messagezClickException.format_message3 |rc|jSrr9r:s r__str__zClickException.__str__6r<rNfilet.IO[t.Any] | Nonec|t}ttd|||jdS)NError: {message}r9r?color)rr _r(r;r/r6r?s rshowzClickException.show9sd <"$$D  ! ! ( (1D1D1F1F ( G G/      r)r1rrr2rrrr?r@rr2) __name__ __module__ __qualname____doc__r.__annotations__r5r;r>rG __classcell__r7s@rr,r,#sBB"#I""""$$$$         rr,cTeZdZUdZdZded<ded<ded<ddfd ZdddZxZS) 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. r-r.Context | Nonectxzt.Final[Command | None]cmdNr1rrr2ct|||_|jr |jjnd|_dSr)r4r5rUcommandrV)r6r1rUr7s rr5zUsageError.__init__Rs> !!!'+x948##Trr?r@cf|t}d}d}|j|jj|jk|jj|j}t d|jjt|t}|d}|j:|jj }t|j d|||tt d| ||dS) Nz"Try '{command} {option}' for help.)key)rXoption rCrBr9)rrUrXget_help_optionget_help_option_namesrEr( command_pathmaxr'rDr get_usager;)r6r?rDhint help_namess rrGzUsageError.showWs6 <"$$D H  00::F)??IIJ9::AA-:3///BD;;;D 8 HNE DH&&((22D22U K K K K  ! ! ( (1D1D1F1F ( G G      rr)r1rrUrTrr2rI) rJrKrLrMr.rNr5rGrOrPs@rrRrRDs"#I""""    :::::::          rrRcJeZdZUdZded<ded< ddfd ZddZxZS) 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. Parameter | NoneparamrrNr1rrUrTrr2cht||||_||_dSr)r4r5rhr)r6r1rUrhrr7s rr5zBadParameter.__init__s1 #&&& $rc*|j|j}nO|j |j|j}n(t d|jSt dt||jS)NzInvalid value: {message}r9z)Invalid value for {param_hint}: {message})rr1)rrhget_error_hintrUrEr(r1r)r6rs rr;zBadParameter.format_messages ? &JJ Z #2248</JJ Z #2248<zMissingParameter.__str__sH| ,0J@DJ677>>*>UU U< r)NNNNN) r1rrUrTrhrgrrrprrr2rH) rJrKrLrMrNr5r;r>rOrPs@rroros  $####""&6:!% % % % % % % %&.&.&.&.P        rrocJeZdZUdZded<ded< ddfd ZddZxZS) NoSuchOptionzbRaised if Click attempted to handle an option that does not exist. .. versionadded:: 4.0 r0 option_namet.Final[list[str] | None]r Nrr1rcabc.Iterable[str] | NonerUrTrr2c|#td|}t||||_|rddlm}|||}nd}||_dS)NzNo such option {name!r}.rrget_close_matches)rEr(r4r5rdifflibrr )r6rr1r rUrpossibilities_r7s rr5zNoSuchOption.__init__s ?233:: :LLG #&&&&  " 1 1 1 1 1 1..{MJJNN!N+rcZ|js|jS|jdt|jSNrsr r1r*r:s rr;zNoSuchOption.format_message7! < ,LL!6t7I!J!JLLLrrl) rrr1rr rrUrTrr2rHrmrPs@rrrs ,,,, #37" ,,,,,,,*MMMMMMMMrrcJeZdZUdZded<ded< ddfd ZddZxZS) NoSuchCommandzdRaised if Click attempted to handle a command that does not exist. .. versionadded:: 8.4.0 r0 command_namerr Nrr1rrrUrTrr2c|#td|}t||||_|rddlm}|||}nd}||_dS)NzNo such command {name!r}.rrr)rEr(r4r5rrrr )r6rr1r rUrrr7s rr5zNoSuchCommand.__init__s ?344;;;NNG #&&&(  " 1 1 1 1 1 1..|]KKNN!N+rcZ|js|jS|jdt|jSrrr:s rr;zNoSuchCommand.format_message*rrrl) rrr1rr rrUrTrr2rHrmrPs@rrr s ,,,, #37" ,,,,,,,*MMMMMMMMrrc4eZdZUdZded< d d fd ZxZS)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. r0rNrr1rUrTrr2cZt||||_dSr)r4r5r)r6rr1rUr7s rr5zBadOptionUsage.__init__<s- #&&&&rr)rrr1rrUrTrr2)rJrKrLrMrNr5rOrPs@rrr0scEI'''''''''''rrceZdZdZdS)BadArgumentUsagezRaised 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 NrJrKrLrMrrrrCsrrc6eZdZUded<d fd Zd d d ZxZS) NoArgsIsHelpErrorr rUrr2crt||dS)N)rU)r4r5get_help)r6rUr7s rr5zNoArgsIsHelpError.__init__Os. S11111rNr?r@cdt||d|jjdS)NT)r?errrD)r r;rUrDrFs rrGzNoArgsIsHelpError.showRs/ T " "4tx~NNNNNNr)rUr rr2rrI)rJrKrLrNr5rGrOrPs@rrrLsjLLL222222OOOOOOOOOrrcDeZdZUdZded<ded<d dfd Zdd ZxZS) FileErrorz"Raised if a file cannot be opened.r0 ui_filenamefilenameNrrcrrr2c|td}t|t||_||_dS)Nz unknown error)rEr4r5r rr)r6rrcr7s rr5zFileError.__init__\sH <_%%D *844  rc^td|j|jS)Nz+Could not open file {filename!r}: {message})rr1)rEr(rr1r:s rr;zFileError.format_messageds3>??FF%t|G   rr)rrrcrrr2rHrmrPs@rrrVsv,,!!!!!!!        rrceZdZdZdS)Abortz=An internal signalling exception that signals Click to abort.NrrrrrrjsGGGGrrc,eZdZUdZdZded<d d d Zd S)ExitzAn exception that indicates that the application should exit with some status code. :param code: the status code to exit with. r.z t.Final[int]r.rcodeintrr2c||_dSrr)r6rs rr5z Exit.__init__ys rN)r)rrrr2)rJrKrLrM __slots__rNr5rrrrrnsL Irr)rrrr)r r!rr)& __future__rcollections.abcabccabctypingtrrEr_compatrglobalsrutilsr r TYPE_CHECKINGcorer r r rr* Exceptionr,rRrfrorrrrrr RuntimeErrorrrrrrrs="""""" $$$$$$******""""""? IIII     Y   B+ + + + + + + + \* * * * * :* * * ZF F F F F |F F F R!M!M!M!M!M:!M!M!MH!M!M!M!M!MJ!M!M!MH'''''Z'''&zOOOOO OOO        (HHHHHLHHH     <     r