jf ddlZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z ddl m Z ddlmZddlmZddlmZdd lmZd d lmZd d lmZd d lmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd 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+m0Z0d d!l+m1Z1ej2r ddl3Z4d d"l5m6Z6ej7d#ej8d$ej9f%Z:ej7d&Z;d'd(d)eee;d$ffd6ZEe dPd'd(d7ejFd8d*ej=dfd9ZGd:ejHd8d;ejHd8d*ejDd8fd<ZIGd=d>ejJZKGd?d(ZLGd@dAZMGdBd+eMZNGdCd/eNZOGdDdEeOZPGdFdGeOZQdHej9d*ej=ej9fdIZRGdJd8ZSGdKdLeSZTGdMdNeSZUdS)QN)abc)contextmanager) ExitStack)update_wrapper)gettext)ngettext)repeat) TracebackType)typesAbort) BadParameter)ClickExceptionExit)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)PacifyFlushWrapperCompletionItemF.)boundVctxContext incompletereturnCommandc#Ktjt|j}||D]<}||r%|||}| |js||fV=dS)zList 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)tcast MultiCommandcommand list_commands startswith get_commandhidden)r,r.multinamer5s j/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/click/core.py_complete_visible_commandsr=0s F< - -E##C(($$ ??: & & $''T22G"7>"Gm### $$F base_commandr4cmd_namecmdregisterc|jrt|tsdS|rd}nd}t|d|jd|d|dt |jdt |jd|jd ) 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 isinstancer4 RuntimeErrorr;type__name__)r?r@rArBhints r<_check_multicommandrJCs  Z\%B%B   <   =    $ $<, $ $  $ $$ $ $.23ii.@ $ $",//8 $ $    $ $ $  r>iterable batch_sizec dtttt||SN)listzipr iter)rKrLs r<batchrR[s% VDNNJ778 9 99r>param Parameterc#K dVdS#t$r$}|j||_||j||_d}~wt$r}|j||_d}~wwxYw)z>Context manager that attaches extra information to exceptions.N)rr,rSr)r,rSes r<augment_usage_errorsrW_s    5=AE  AG  5=AE s A3 AAAinvocation_orderdeclaration_ordercrdddtjttfffd }t ||S)zGiven 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. itemrTr/c |}n#t$rtd}YnwxYw|j |fS)Ninf)index ValueErrorfloatis_eager)r[idxrXs r<sort_keyz,iter_params_for_processing..sort_key{sY )//55CC   ,,CCC = #%%s 55key)r2Tupleboolr`sorted)rXrYrcs` r<iter_params_for_processingrirsP&{&qwtU{';&&&&&& # 2 2 22r>ceZdZdZejZ ejZ ejZ ejZ ejZ 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) rH __module__ __qualname____doc__enumauto COMMANDLINE ENVIRONMENTDEFAULT DEFAULT_MAPPROMPTr>r<rkrksi  $)++K:$)++K>dikkG6$)++KA TY[[F@@r>rkc#>eZdZUdZeZejded< dMdddej dd ej e d ej ej d ej e d ej ej e ej fd ej e dej e dedej edej edej edej eje dej eje ge fdej edej eddf"dZdeje ej ffdZdNdZdej ejedej edej eddfdZedOd edejdfd!Zedeje ej ffd"Zdefd#Zd$ejedefd%Z d&ejd'ej fdejd'ej ffd(Z!dPd)Z"ede fd*Z#dNd+Z$d,ejedej efd-Z%d,ejedefd.Z&ej' dOd/e d0d1dej ej fd2Z(ej' dQd/e d0d3dej ej)ej ejgej fffd4Z(dOd/e d0edej ej fd5Z(d6e dd7fd8Z*dRd9Z+dSd;e dd7fd<Z,de fd=Z-de fd>Z.dTd?Z/ej'd@dAdBej dCej defdDZ0ej'd@ddBej dCej dej fdEZ0d@ej)dFdBej dCej dej)ej effdGZ0dHddBej dCej dej fdIZ1d/e dJe2ddfdKZ3d/e dej e2fdLZ4dS)Ur-aThe context is a special internal object that holds state relevant for the script execution at every single level. It's normally invisible to commands unless they opt-in to getting access to it. The context is useful as it can pass internal objects around and can control special execution features such as reading data from environment variables. A context can be used as context manager in which case it will call :meth:`close` on teardown. :param command: the command class for this context. :param parent: the parent context. :param info_name: the info name for this invocation. Generally this is the most descriptive name for the script or command. For the toplevel script it is usually the name of the script, for commands below it it's the name of the script. :param obj: an arbitrary object of user data. :param auto_envvar_prefix: the prefix to use for automatic environment variables. If this is `None` then reading from environment variables is disabled. This does not affect manually set environment variables which are always read. :param default_map: a dictionary (like object) with default values for parameters. :param terminal_width: the width of the terminal. The default is inherit from parent context. If no context defines the terminal width then auto detection will be applied. :param max_content_width: the maximum width for content rendered by Click (this currently only affects help pages). This defaults to 80 characters if not overridden. In other words: even if the terminal is larger than that, Click will not format things wider than 80 characters by default. In addition to that, formatters might add some safety mapping on the right. :param resilient_parsing: if this flag is enabled then Click will parse without any interactivity or callback invocation. Default values will also be ignored. This is useful for implementing things such as completion support. :param allow_extra_args: if this is set to `True` then extra arguments at the end will not raise an error and will be kept on the context. The default is to inherit from the command. :param allow_interspersed_args: if this is set to `False` then options and arguments cannot be mixed. The default is to inherit from the command. :param ignore_unknown_options: instructs click to ignore options it does not know and keeps them for later processing. :param help_option_names: optionally a list of strings that define how the default help parameter is named. The default is ``['--help']``. :param token_normalize_func: an optional function that is used to normalize tokens (options, choices, etc.). This for instance can be used to implement case insensitive behavior. :param color: controls if the terminal supports ANSI colors or not. The default is autodetection. This is only needed if ANSI codes are used in texts that Click prints which is by default not the case. This for instance would affect help output. :param show_default: Show the default value for commands. If this value is not set, it defaults to the value from the parent context. ``Command.show_default`` overrides this default for the specific command. .. versionchanged:: 8.1 The ``show_default`` parameter is overridden by ``Command.show_default``, instead of the other way around. .. versionchanged:: 8.0 The ``show_default`` parameter defaults to the value from the parent context. .. versionchanged:: 7.1 Added the ``show_default`` parameter. .. versionchanged:: 4.0 Added the ``color``, ``ignore_unknown_options``, and ``max_content_width`` parameters. .. versionchanged:: 3.0 Added the ``allow_extra_args`` and ``allow_interspersed_args`` parameters. .. versionchanged:: 2.0 Added the ``resilient_parsing``, ``help_option_names``, and ``token_normalize_func`` parameters. rformatter_classNFr5r0parent info_nameobjauto_envvar_prefix default_mapterminal_widthmax_content_widthresilient_parsingallow_extra_argsallow_interspersed_argsignore_unknown_optionshelp_option_namestoken_normalize_funccolor show_defaultr/c||_||_||_i|_g|_g|_|rt |jn t |_| ||j}||_t|di|_ |%|#|!|j |j |}||_ d|_ | ||j}||_| ||j}||_| |j} | |_| |j} | |_| |j} | |_| ||j} ndg} | |_| ||j}||_| |_|4|1|j*|j#|jd|j}n|}||dd}||_| ||j}||_| ||j}||_g|_d|_i|_t=|_dS)Nmetaz--help_-r) ryr5rzparamsargsprotected_argsset _opt_prefixesr{getattr_metar}getinvoked_subcommandr~rrrrrrrr|upperreplacerr_close_callbacks_depth_parameter_sourcer _exit_stack)selfr5ryrzr{r|r}r~rrrrrrrrrs r<__init__zContext.__init__s(  "+- !# ,.FL)WV-A)B)B)BRURWRW ;6-*C)0)D)D   %"". ,00;;KEP48  !f&8#2N0>  $); & 8 3D  #&7  !1 " *&-&E # .E$ ! )%,%C "-C#  $!$*$<!!%-J!/@  'F,>#)#> ! !(9  %"-9N.0KK4>3G3G3I3IKK#"4!9!9!;!;   )!3!;!;C!E!E 3E =V/LE(-  F$6!.L/;?A ?A$;;r>cv|j||j|j|j|j|jdS)a*Gather information that could be useful for a tool generating user-facing documentation. This traverses the entire CLI structure. .. code-block:: python with Context(cli) as ctx: info = ctx.to_info_dict() .. versionadded:: 8.0 )r5rzrrrr|)r5 to_info_dictrzrrrr|rs r<rzContext.to_info_dictsC|0066 $ 5'+'C&*&A"&"9    r>cD|xjdz c_t||SNr )rrrs r< __enter__zContext.__enter__s% q T r>exc_type exc_valuetbc|xjdzc_|jdkr|tdSNr r)rcloser)rrrrs r<__exit__zContext.__exit__s; q ;!   JJLLL r>Tcleanupc#K|s|xjdz c_ |5}|Vdddn #1swxYwY|s|xjdzc_dSdS#|s|xjdzc_wxYw)aIThis helper method can be used with the context object to promote it to the current thread local (see :func:`get_current_context`). The default behavior of this is to invoke the cleanup functions which can be disabled by setting `cleanup` to `False`. The cleanup functions are typically used for things such as closing file handles. If the cleanup is intended the context object can also be directly used as a context manager. Example usage:: with ctx.scope(): assert get_current_context() is ctx This is equivalent:: with ctx: assert get_current_context() is ctx .. versionadded:: 5.0 :param cleanup: controls if the cleanup functions should be run or not. The default is to run these functions. In some situations the context only wants to be temporarily pushed in which case this can be disabled. Nested pushes automatically defer the cleanup. r N)r)rrrvs r<scopez Context.scopes:  KK1 KK !                 ! q  ! !7 ! q s&A ) A -A -A Ac|jS)aThis is a dictionary which is shared with all the contexts that are nested. It exists so that click utilities can store some state here if they need to. It is however the responsibility of that code to manage this dictionary well. The keys are supposed to be unique dotted strings. For instance module paths are a good choice for it. What is stored in there is irrelevant for the operation of click. However what is important is that code that places data here adheres to the general semantics of the system. Example usage:: LANG_KEY = f'{__name__}.lang' def set_language(value): ctx = get_current_context() ctx.meta[LANG_KEY] = value def get_language(): return get_current_context().meta.get(LANG_KEY, 'en_US') .. versionadded:: 5.0 )rrs r<rz Context.metas 4zr>cD||j|jS)a=Creates the :class:`~click.HelpFormatter` for the help and usage output. To quickly customize the formatter class used without overriding this method, set the :attr:`formatter_class` attribute. .. versionchanged:: 8.0 Added the :attr:`formatter_class` attribute. )width max_width)rxr~rrs r<make_formatterzContext.make_formatters,##%1G$   r>context_managerc6|j|S)aRegister a resource as if it were used in a ``with`` statement. The resource will be cleaned up when the context is popped. Uses :meth:`contextlib.ExitStack.enter_context`. It calls the resource's ``__enter__()`` method and returns the result. When the context is popped, it closes the stack, which calls the resource's ``__exit__()`` method. To register a cleanup function for something that isn't a context manager, use :meth:`call_on_close`. Or use something from :mod:`contextlib` to turn it into a context manager first. .. code-block:: python @click.group() @click.option("--name") @click.pass_context def cli(ctx): ctx.obj = ctx.with_resource(connect_db(name)) :param context_manager: The context manager to enter. :return: Whatever ``context_manager.__enter__()`` returns. .. versionadded:: 8.0 )r enter_context)rrs r< with_resourcezContext.with_resource%s6--o>>>r>f.c6|j|S)aRegister a function to be called when the context tears down. This can be used to close resources opened during the script execution. Resources that support Python's context manager protocol which would be used in a ``with`` statement should be registered with :meth:`with_resource` instead. :param f: The function to execute on teardown. )rcallback)rrs r< call_on_closezContext.call_on_closeBs((+++r>c^|jt|_dS)zInvoke all close callbacks registered with :meth:`call_on_close`, and exit all context managers entered with :meth:`with_resource`. N)rrrrs r<rz Context.closeNs+    $;;r>cxd}|j|j}|j|jjg}t|jjt rJ|jj|D]*}|||+d |d|}| S)zThe computed command path. This is used for the ``usage`` information on the help page. It's automatically created by combining the info names of the chain of contexts to the root. N ) rzry command_pathrEr5r0 get_paramsextendget_usage_piecesjoinlstrip)rrparent_command_pathrSs r<rzContext.command_pathWs  > %B ; "#';#;"< $+-w77 M![0;;DAAMME'..u/E/Ed/K/KLLLLHH01188B88Byy{{r>c4|}|j|j}|j|S)zFinds the outermost context.ry)rnodes r< find_rootzContext.find_rootjs%k%;Dk% r> object_typecX|}|%t|j|r|jS|j}|%dS)z)Finds the closest object of a given type.N)rEr{ry)rrrs r< find_objectzContext.find_objectqs>&*$(K00 x;D  tr>cV||}||x|_}|S)zLike :meth:`find_object` but sets the innermost object to a new instance of `object_type` if it does not exist. )rr{)rrrs r< ensure_objectzContext.ensure_object}s3  k * * :'KMM )DHr r>r;callte.Literal[True]cdSrNrvrr;rs r<lookup_defaultzContext.lookup_default  r>zte.Literal[False]cdSrNrvrs r<rzContext.lookup_defaultrr>c|j7|j|}|rt|r |S|SdS)a*Get the default for a parameter from :attr:`default_map`. :param name: Name of the parameter. :param call: If the default is a callable, call it. Disable to return the callable instead. .. versionchanged:: 8.0 Added the ``call`` parameter. N)r}rcallable)rr;rvalues r<rzContext.lookup_defaultsM   '$((..E  uwwLtr>message te.NoReturnc"t||)zAborts the execution of the program with a specific error message. :param message: the error message to fail with. r)rrs r<failz Context.fails $'''r>ct)zAborts the script.r rs r<abortz Context.aborts gg r>rcodec t|)z-Exits the application with a given exit code.r)rrs r<exitz Context.exits4jjr>c6|j|S)zaHelper method to get formatted usage string for the current context and command. )r5 get_usagers r<rzContext.get_usages|%%d+++r>c6|j|S)z^Helper method to get formatted help page for the current context and command. )r5get_helprs r<rzContext.get_helps|$$T***r>cBt|||j|S)zvCreate a new context of the same type as this context, but for a new command. :meta private: rzry)rGr;)rr5s r<_make_sub_contextzContext._make_sub_contexts# tDzz'W\$GGGGr>_Context__callbackt.Callable[..., V]rkwargscdSrNrv_Context__selfrrrs r<invokezContext.invoke  r>cdSrNrvrs r<rzContext.invokerr>)r0rc<t|tr|}|jtdt jd|j}||}|jD]C}|j|vr8|j r1| || |||j<D|j |n|}t|5|5||i|cdddcdddS#1swxYwY ddddS#1swxYwYdS)aInvokes a command callback in exactly the way it expects. There are two ways to invoke this method: 1. the first argument can be a callback and all other arguments and keyword arguments are forwarded directly to the function. 2. the first argument is a click command object. In that case all arguments are forwarded as well but proper click parameters (options and click arguments) must be keyword arguments and Click will fill in defaults. Note that before Click 3.2 keyword arguments were not properly filled in against the intention of this code and no context was created. For more information about this change and why it was done in a bugfix release see :ref:`upgrade-to-3.2`. .. versionchanged:: 8.0 All ``kwargs`` are tracked in :attr:`params` so they will be passed if :meth:`forward` is called at multiple levels. Nz?The given command does not have a callback that can be invoked.r)rEr0r TypeErrorr2r3rrr; expose_valuetype_cast_value get_defaultupdaterW)rrrr other_cmdr,rSs r<rzContext.invokes2 j' * * "I!)UV$8):LMM **955C")  :V++0B+).)>)>U..s33**F5:& J  f % % % %C !& ) ) 3 3 3 3!z42622 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3s6DC8 D8C< <D?C< DDD _Context__cmdct|tstd|jD]}||vr|j|||<|j|g|Ri|S)azSimilar to :meth:`invoke` but fills in default keyword arguments from the current context if the other command expects it. This cannot invoke callbacks directly, only other commands. .. versionchanged:: 8.0 All ``kwargs`` are tracked in :attr:`params` so they will be passed if ``forward`` is called at multiple levels. zCallback is not a command.)rEr0rrr)rrrrrSs r<forwardzContext.forwardst%)) :899 9] 5 5EF"" & e 4u v}U4T444V444r>sourcec||j|<dS)zSet the source of a parameter. This indicates the location from which the value of the parameter was obtained. :param name: The name of the parameter. :param source: A member of :class:`~click.core.ParameterSource`. N)r)rr;rs r<set_parameter_sourcezContext.set_parameter_source&s(.t$$$r>c6|j|S)aXGet the source of a parameter. This indicates the location from which the value of the parameter was obtained. This can be useful for determining when a user specified a value on the command line that is the same as the default value. It will be :attr:`~click.core.ParameterSource.DEFAULT` only if the value was actually taken from the default. :param name: The name of the parameter. :rtype: ParameterSource .. versionchanged:: 8.0 Returns ``None`` if the parameter was not provided from any source. )rr)rr;s r<get_parameter_sourcezContext.get_parameter_source/s %))$///r>)NNNNNNNFNNNNNNN)r/r-T)r/N.)r/r)r)r5r0r/r-)5rHrlrmrnrrxr2Type__annotations__OptionalstrAnyMutableMappingintrgListCallablerDictrr BaseExceptionr rrIteratorrpropertyrrContextManagerr+rrrrrrroverloadrUnionrrrrrrrrrkrrrvr>r<r-r-s\\B0=OQVO,<<< )-%)!%.2@D*.-1"'-1483759CG"&)-#j'j'j' 9%j':c? j' Z  j' JsO j'Z 0ae <=j' 3j':c?j' j'*T*j'"#D!1j'!" 4 0j':afSk2j' jSE3J)?@j' z$!j'"j&#j'$ %j'j'j'j'X afS!%Z0    * *QVM23 :m,  J} %      #!#!T#!QZ -B#!#!#!^#!JafS!%Z(X6      ?Q-=a-@?Q????: ,qz#qu*5 ,!*S!%Z:P , , , ,''''cX$ qvay QZ]    qZ48   1 AE    Z Z58   2 AGAE1:b!%i#889 :   Z 3daj>O((C(M((((],3,,,, +#++++ HHHHZ ( u %     Z Z  u %      Z 33G;<33u33% 33   33333333j5 5)*5:;%5 5555*..o.$....00O1L000000r>cveZdZUdZeZejeed<dZ dZ dZ d'dej e dej eje ejfddfd Zd edeje ejffd Zde fd Zd ede fd Zd ede fdZ d'dej e deje dej edejdef dZd edeje deje fdZd edejfdZd ede dejdfdZej d(dej eje dej e dej e dddejddf dZej d)dej eje dej e dej e dedejdejf d Z d*dej eje dej e dej e ded!edejdejfd"Z d'd#eje ejfde dej e ddfd$Zdejd%ejdejfd&Z dS)+ BaseCommandaThe base command implements the minimal API contract of commands. Most code will never use this as it does not implement a lot of useful functionality but it can act as the direct subclass of alternative parsing methods that do not depend on the Click parser. For instance, this can be used to bridge Click and other systems like argparse or docopt. Because base commands do not implement a lot of the API that other parts of Click take for granted, they are not supported for all operations. For instance, they cannot be used with the decorators usually and they have no built-in callback system. .. versionchanged:: 2.0 Added the `context_settings` parameter. :param name: the name of the command to use unless a group overrides it. :param context_settings: an optional dictionary with defaults that are passed to the context object. context_classFTNr;context_settingsr/c*||_|i}||_dSrN)r;r)rr;rs r<rzBaseCommand.__init__cs(  #! ?Or>r,cd|jiS)aiGather information that could be useful for a tool generating user-facing documentation. This traverses the entire structure below this command. Use :meth:`click.Context.to_info_dict` to traverse the entire CLI structure. :param ctx: A :class:`Context` representing this command. .. versionadded:: 8.0 r;r;rr,s r<rzBaseCommand.to_info_dictts ""r>c2d|jjd|jdSN __class__rHr;rs r<__repr__zBaseCommand.__repr__"94>*99TY9999r>c td)NzBase commands cannot get usageNotImplementedErrorrs r<rzBaseCommand.get_usages!"BCCCr>c td)NzBase commands cannot get helpr$rs r<rzBaseCommand.get_helps!"ABBBr>rzrryextrac |jD]\}}||vr|||<|j|f||d|}|d5|||dddn #1swxYwY|S)aThis function when given an info name and arguments will kick off the parsing and create a new :class:`Context`. It does not invoke the actual command callback though. To quickly customize the context class used without overriding this method, set the :attr:`context_class` attribute. :param info_name: the info name for this invocation. Generally this is the most descriptive name for the script or command. For the toplevel script it's usually the name of the script, for commands below it's the name of the command. :param args: the arguments to parse as list of strings. :param parent: the parent context if available. :param extra: extra keyword arguments forwarded to the context constructor. .. versionchanged:: 8.0 Added the :attr:`context_class` attribute. rFrN)ritemsrr parse_args)rrzrryr'rerr,s r< make_contextzBaseCommand.make_contexts6/5577 # #JC%"c  d  %f  8=  YYuY % % ' ' OOC & & & ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' sA33A7:A7c td)zGiven a context and a list of arguments this creates the parser and parses the arguments, then modifies the context as necessary. This is automatically invoked by :meth:`make_context`. z1Base commands do not know how to parse arguments.r$)rr,rs r<r+zBaseCommand.parse_argss ""UVVVr>c td)z{Given a context, this invokes the command. The default implementation is raising a not implemented error. z*Base commands are not invocable by defaultr$rs r<rzBaseCommand.invokes""NOOOr>r.r(cddlmg}jdjtjt r<jjr0|fdt|Djd|S)aReturn a list of completions for the incomplete value. Looks at the names of chained multi-commands. Any command could be part of a chained multi-command, so sibling commands are valid at any point during command completion. Other command classes will return more completions. :param ctx: Invocation context for this command. :param incomplete: Value being completed. May be empty. .. versionadded:: 8.0 rr'Nc3nK|]/\}}|jv||V0dShelpN)rget_short_help_str).0r;r5r(r,s r< z-BaseCommand.shell_complete..s\%g3#555#N4g.H.H.J.JKKK5555r>) click.shell_completionr(ryrEr5r4rDrr=rr,r.resultsr(s ` @r<shell_completezBaseCommand.shell_completes :99999,.j$*C#+|44 9J )CC)T)T j$r> prog_name complete_varstandalone_moderrc dSrNrvrrr;r<r=r's r<mainzBaseCommand.main  r>.c dSrNrvr?s r<r@zBaseCommand.mainrAr>windows_expand_argsc F|6tjdd}tjdkr|rt |}nt |}|t }|||| |j||fi|5}| |}|s|cdddS| dddn #1swxYwYdSdS#ttf$r.} ttjt| d} ~ wt $r;} |s| tj | jYd} ~ dSd} ~ wt&$r} | jt(jkrt-jt,jt3tjt_t-jt,jt3tjt_tj dnYd} ~ dSd} ~ wwxYw#t6$r3} |rtj | jn | jcYd} ~ SYd} ~ dSd} ~ wt$rC|stt9dtjtj dYdSwxYw)aThis is the way to invoke a script with all the bells and whistles as a command line application. This will always terminate the application after a call. If this is not wanted, ``SystemExit`` needs to be caught. This method is also available by directly calling the instance of a :class:`Command`. :param args: the arguments that should be used for parsing. If not provided, ``sys.argv[1:]`` is used. :param prog_name: the program name that should be used. By default the program name is constructed by taking the file name from ``sys.argv[0]``. :param complete_var: the environment variable that controls the bash completion support. The default is ``"__COMPLETE"`` with prog_name in uppercase. :param standalone_mode: the default behavior is to invoke the script in standalone mode. Click will then handle exceptions and convert them into error messages and the function will never return but shut down the interpreter. If this is set to `False` they will be propagated to the caller and the return value of this function is the return value of :meth:`invoke`. :param windows_expand_args: Expand glob patterns, user dir, and env vars in command line args on Windows. :param extra: extra keyword arguments are forwarded to the context constructor. See :class:`Context` for more information. .. versionchanged:: 8.0.1 Added the ``windows_expand_args`` parameter to allow disabling command line arg expansion on Windows. .. versionchanged:: 8.0 When taking arguments from ``sys.argv`` on Windows, glob patterns, user dir, and env vars are expanded. .. versionchanged:: 3.0 Added the ``standalone_mode`` parameter. Nr nt)filezAborted!)sysargvosr;r"rOr!_main_shell_completionr,rrEOFErrorKeyboardInterruptr#stderrrrshow exit_codeOSErrorerrnoEPIPEr2r3TextIOr&stdoutrr) rrr;r<r=rCr'r,rrVs r<r@zBaseCommand.mains#f <8ABBrc|j|i|S)zAlias for :meth:`main`.)r@rrrs r<__call__zBaseCommand.__call__sty$)&)))r>rN)NNNT)NNN.)NNNTT)!rHrlrmrnr-rr2rrrrrrrrrrr rr!rrr r,r+rr:rSequencer@rgrJr_rvr>r<rrBst0&-M16'?,,,"" FJOOjoO*Q%5c15j%ABO  OOOO" # #AF3:,> # # # #:#::::DWDDDDDCGCCCCC'+ %%:c?%fSk% 7# %  %  %%%%NWgWQVC[WQVC[WWWWP'PaePPPP 'sqvFV?W:Z-1%)(,.2   jC) :c? jo  ,        Z Z-1%)(, #   jC) :c? jo          Z -1%)(, $$( oojC)o:c?ojo o  o " oo ooooj)- "3:.jo   @*ae*qu*******r>rc|eZdZdZ d/dejedejejeejfdejej d ejfd ejej d d ejed ejedejedejede de de de ddffd Z de dejeejfffd Zde defdZde dej d fdZde deddfdZde dej efdZde dej efdZde dejdfdZde defd Zde defd!Zd0d#edefd$Zde deddfd%Zde deddfd&Zde deddfd'Zde deddfd(Zde d)ej edej efd*Z de dejfd+Z!de d,edej d-ffd. Z"xZ#S)1r0aCommands are the basic building block of command line interfaces in Click. A basic command handles command line parsing and might dispatch more parsing to commands nested below it. :param name: the name of the command to use unless a group overrides it. :param context_settings: an optional dictionary with defaults that are passed to the context object. :param callback: the callback to invoke. This is optional. :param params: the parameters to register with this command. This can be either :class:`Option` or :class:`Argument` objects. :param help: the help string to use for this command. :param epilog: like the help string but it's printed at the end of the help page after everything else. :param short_help: the short help to use for this command. This is shown on the command listing of the parent command. :param add_help_option: by default each command registers a ``--help`` option. This can be disabled by this parameter. :param no_args_is_help: this controls what happens if no arguments are provided. This option is disabled by default. If enabled this will add ``--help`` as argument if no arguments are passed :param hidden: hide this command from help outputs. :param deprecated: issues a message indicating that the command is deprecated. .. versionchanged:: 8.1 ``help``, ``epilog``, and ``short_help`` are stored unprocessed, all formatting is done when outputting help text, not at init, and is done even if not using the ``@command`` decorator. .. versionchanged:: 8.0 Added a ``repr`` showing the command name. .. versionchanged:: 7.1 Added the ``no_args_is_help`` parameter. .. versionchanged:: 2.0 Added the ``context_settings`` parameter. N [OPTIONS]TFr;rr.rrTr3epilog short_helpoptions_metavaradd_help_optionno_args_is_helpr9 deprecatedr/c t||||_|pg|_||_||_||_||_| |_| |_ | |_ | |_ dSrN) superrrrr3rcrerdrfrgr9rh)rr;rrrr3rcrdrerfrgr9rhr s r<rzCommand.__init__su /000! ,2r,ct|}|d||D|j|j|j|j|j|S)Nc6g|]}|Srv)r)r5rSs r< z(Command.to_info_dict..s$KKKUE&&((KKKr>)rr3rcrdr9rh) rjrrrr3rcrdr9rh)rr, info_dictr s r<rzCommand.to_info_dictsuGG((-- KKdooc6J6JKKK;;    r>c|}||||dS)zmFormats the usage line into a string and returns it. Calls :meth:`format_usage` internally.  )r format_usagegetvaluerstriprr, formatters r<rzCommand.get_usagesK &&((  #y)))!!##**4000r>cN|j}||}|g||}|SrN)rget_help_option)rr,r help_options r<rzCommand.get_paramss6 [**3//  "#2#{#B r>ruc||}||jd|dS)zsWrites the usage line into the formatter. This is a low-level method called by :meth:`get_usage`. rN)collect_usage_pieces write_usagerr)rr,rupiecess r<rqzCommand.format_usagesB **3//c.0@0@AAAAAr>c|jr|jgng}||D]*}|||+|S)zhReturns all the pieces that go into the usage line and returns it as a list of strings. )rerrr)rr,rrSs r<rzzCommand.collect_usage_piecess_(,'; Cd" # #__S)) 3 3E IIe,,S11 2 2 2 2 r>ct|j}|jD]6}||j||j7t |S)z&Returns the names for the help option.)rrrdifference_updateoptssecondary_optsrO)rr, all_namesrSs r<get_help_option_nameszCommand.get_help_option_namess_-.. [ > >E  ' ' 3 3 3  ' '(< = = = =Ir>Optionc ||}|r|jsdSdtdddtddfd}t |ddd |t d  S) zReturns the help option object.Nr,rSrTrr/c|rE|js@t||j|dSdSdS)Nr)rr#rrr)r,rSrs r< show_helpz*Command.get_help_option..show_helpsV S2 S\\^^395555     r>TFzShow this message and exit.)is_flagrarrr3)rrfr-rrr)rr, help_optionsrs r<rwzCommand.get_help_option s11#66  4#7 4 7 ; s t      011     r>ct|}||D]}||||S)z6Creates the underlying option parser for this command.)rr add_to_parser)rr,parserrSs r< make_parserzCommand.make_parser sHc""__S)) - -E    , , , , r>c|}||||dS)zfFormats the help into a string and returns it. Calls :meth:`format_help` internally. rp)r format_helprrrsrts r<rzCommand.get_help'sK &&((  i(((!!##**4000r>-limitc|jrtj|j}n|jrt |j|}nd}|jr#t d|}|S)z`Gets short help for the command or makes it by shortening the long help string. r(Deprecated) {text}text) rdinspectcleandocr3r$rhrformatstrip)rrrs r<r4zCommand.get_short_help_str0s{ ? #DO44DD Y *49e<*++222==Dzz||r>c||||||||||||dS)a0Writes the help into the formatter if it exists. This is a low-level method called by :meth:`get_help`. This calls the following methods: - :meth:`format_usage` - :meth:`format_help_text` - :meth:`format_options` - :meth:`format_epilog` N)rqformat_help_textformat_options format_epilogrts r<rzCommand.format_help@sb #y))) c9--- C+++ 3 *****r>c|j3tj|jdd}nd}|jr#t d|}|rX||5| |ddddS#1swxYwYdSdS)z3Writes the help text to the formatter if it exists.N rrrr) r3rr partitionrhrrwrite_paragraph indentation write_text)rr,rurs r<rzCommand.format_help_textQs  9 #DI..88>>qADDD ? >*++222==D  +  % % ' ' '&&(( + +$$T*** + + + + + + + + + + + + + + + + + + + +sB44B8;B8c:g}||D].}||}|||/|rR|t d5||ddddS#1swxYwYdSdS)z8Writes all the options into the formatter if they exist.NOptions)rget_help_recordappendsectionrwrite_dl)rr,rurrSrs r<rzCommand.format_optionsbs__S))  E&&s++B~ B  )""1Y<<00 ) )""4((( ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )s+BBBc|jrqtj|j}||5||ddddS#1swxYwYdSdS)z2Writes the epilog into the formatter if it exists.N)rcrrrrr)rr,rurcs r<rzCommand.format_epilogns ; -%dk22F  % % ' ' '&&(( - -$$V,,, - - - - - - - - - - - - - - - - - -  - -s A,,A03A0rc |sJ|jrC|js">dK/ T__S=Q=QRR E EE33CtDDKE44  , S5J  HH<=II&chhs3~~66&77       !5666 r>c|jrHtd|j}t t |dd|j|j|jfi|jSdS)zeGiven a context, this invokes the attached callback (if it exists) in the right way. z7DeprecationWarning: The command {name!r} is deprecated.rred)fgT)errN) rhrrr;r#r rrr)rr,rs r<rzCommand.invokes ? 5If$)f$$  w5)))t 4 4 4 4 = $3:dm::sz:: : % $r>r.r(cddlmg}rds||D]}t t r4js-js'|j tj urL| fdgj jD~| t||S)aReturn a list of completions for the incomplete value. Looks at the names of options and chained multi-commands. :param ctx: Invocation context for this command. :param incomplete: Value being completed. May be empty. .. versionadded:: 8.0 rr'c3fK|]+}||jV,dSr1)r7r3)r5r;r(r.rSs r<r6z)Command.shell_complete..sZz22"N4ej999r>)r7r(isalnumrrErr9multiplerr;rkrqrrrrjr:)rr,r.r9r(rSr s ` @@r<r:zCommand.shell_completes2 :99999,.  jm3355 --  "5&11 | "N   44UZ@@*677 D%* Du/C D uww--c:>>???r>) NNNNNNrbTFFF)r)$rHrlrmrnr2rrrrr r rgrr-r rrrrrqrzrrwrrrr r4rrrrr+rr: __classcell__r s@r<r0r0s''XFJ7;26 $"&&*+6 $ % %%jo%*Q%5c15j%AB%*QZQU 34 %  16+./ % jo % 3%JsO%C%%%%% %%%%%%@  AF3:,>      1W11111g!&*=BBMBdBBBB  AF3K    QVC[ 7 qz(/C    *w<1G11111S +w+=+T++++"+G+ +$++++" )' )m ) ) ) ) )--]-t----gQVC[QVC[0 ;' ;ae ; ; ; ;!'!s!qvFV?W!!!!!!!!!!r>ceZdZdZdZdZ d!dejede deje dejed e d ejej d ej fd ej d dffd Z de d ejeej fffd Zde d ejeffd Zde ded dffd Zd"de d ej egeffdZde ded dfdZde dejed ejeffd Zde d ej ffd Zde dejed ejejeejeejeffdZde ded ejefdZde d ejefdZde ded ejdffd ZxZS)#r4aA multi command is the basic implementation of a command that dispatches to subcommands. The most common version is the :class:`Group`. :param invoke_without_command: this controls how the multi command itself is invoked. By default it's only invoked if a subcommand is provided. :param no_args_is_help: this controls what happens if no arguments are provided. This option is enabled by default if `invoke_without_command` is disabled or disabled if it's enabled. If enabled this will add ``--help`` as argument if no arguments are passed. :param subcommand_metavar: the string that is used in the documentation to indicate the subcommand place. :param chain: if this is set to `True` chaining of multiple subcommands is enabled. This restricts the form of commands in that they cannot have optional arguments but it allows multiple commands to be chained together. :param result_callback: The result callback to attach to this multi command. This can be set or changed later with the :meth:`result_callback` decorator. :param attrs: Other command arguments described in :class:`Command`. TFNr;invoke_without_commandrgsubcommand_metavarrDresult_callback.attrsr/c tj|fi||| }||_||_||rd}nd}||_||_||_|jr5|jD]/}t|tr|j std.dSdS)Nz*COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...zCOMMAND [ARGS]...zr,ct|}i}||D]v}|||}|||}|d5||||<dddn #1swxYwYw|||j|S)NFr))commandsrD)rjrr6r8rrrrD)rr,rnrr;r5sub_ctxr s r<rzMultiCommand.to_info_dictsGG((-- &&s++ ? ?D&&sD11G++G44Gu-- ? ?!(!5!5g!>!> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ($*===sB%%B) ,B) c~t|}||j|SrN)rjrzrr)rr,rr s r<rzz!MultiCommand.collect_usage_piecess4 WW ) )# . . $)*** r>rucxt|||||dSrN)rjrformat_commands)rr,rur s r<rzMultiCommand.format_optionss9 sI... S),,,,,r>rc4dtdtffd }|S)aAdds a result callback to the command. By default if a result callback is already registered this will chain them but this can be disabled with the `replace` parameter. The result callback is invoked with the return value of the subcommand (or the list of return values from all subcommands if chaining is enabled) as well as the parameters as they would be passed to the main callback. Example:: @click.group() @click.option('-i', '--input', default=23) def cli(input): return 42 @cli.result_callback() def process_result(result, input): return result + input :param replace: if set to `True` an already existing result callback will be removed. .. versionchanged:: 8.0 Renamed from ``resultcallback``. .. versionadded:: 3.0 rr/cjr _Sfd}ttjt|x_}|S)Nc4|g|Ri|}|g|Ri|SrNrv)_MultiCommand__valuerrinnerr old_callbacks r<functionzAMultiCommand.result_callback..decorator..functionBsB$ W>t>>>v>>q0000000r>)rrr2r3r))rrrrrrs` @r< decoratorz/MultiCommand.result_callback..decorator;sm0L#w#()% 1 1 1 1 1 1*8q(8K8KQ)O)O OD !BIr>)r))rrrs`` r<rzMultiCommand.result_callbacks=:  q       r>c(g}||D]:}|||}||jr#|||f;t |r|jdz t d|Dz }g}|D]1\}}||}|||f2|rT|td5| |ddddS#1swxYwYdSdSdS)zeExtra format methods for multi methods that adds all the commands after the options. Nc3@K|]}t|dVdS)rNr)r5rAs r<r6z/MultiCommand.format_commands..\s,-N-Ncc#a&kk-N-N-N-N-N-Nr>Commands) r6r8r9rrrmaxr4rrr) rr,rur subcommandrArrowsr3s r<rzMultiCommand.format_commandsKs,,S11 / /J""3 33C{z  OOZ- . . . . x== -Oa'#-N-NX-N-N-N*N*NNED#+ 0 0 C--e44 Z.//// -&&q}}55--&&t,,,------------------ - - - -s DD Drc\|sJ|jrC|js!%C CHH  >+/8T!""X (C xr>cdtjdtjffd }jsxjrO5t }|jrgn|cdddS#1swxYwYtdgjj }g_ g_js‰5 |\}}}|J|_ t | ||}|5||j |cdddcdddS#1swxYwY dddn #1swxYwY5|rdnd_ t g}|r^ |\}}}|J| ||dd }|||j gc}|_ |^g}|D]I}|5||j |dddn #1swxYwYJ||cdddS#1swxYwYdS) Nrr/cHjjj|fij}|SrN)rrrrr,rs r<_process_resultz,MultiCommand.invoke.._process_resultws1$0" 4#8%NN3:NNLr>zMissing command.r*TF)ryrr)r2rrrrjrrDrrrresolve_commandrr,r5r) rr,rrrr@rArcontextsr s `` r<rzMultiCommand.invokevs 15 QU        ! ,* EEE,,B*?+C22DDEEEEEEEEEEEEEEEE HHQ)** + + +0#/ch/ z L L L&*&:&:3&E&E##t)1&s###**8T#*FFLL*?7?+A+A'+J+JKKLLLLLLL  L L L L L L L L LLLLLLLLL  L L L L L L L L L L L L L L L ' ',0%:SSdC " GGNN3    H 6&*&:&:3&E&E##t**%),1 +(((%,\2"gl 6B# ? ???IIgo44W==>>>???????????????"?2&&3 ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 's5A55A9<A9 A!E>*#E& E>&E* *E>-E* .E>>FF BI?".I I?I I?#I $I??JJct|d}|}|||}|2|j+||}|||}|m|jsft |dr|||j|td ||r|nd||ddfS)NrzNo such command {name!r}.rr ) r%r8rrrr+rrrr)rr,rr@original_cmd_namerAs r<rzMultiCommand.resolve_commandsDG$$$sH-- ;33?//99H""311C ;s4;""1% /SX... HHQ233::@Q:RR S S S(xxD#tABBx77r>r@ct)z{Given a context and a command name, this returns a :class:`Command` object if it exists or returns `None`. r$rr,r@s r<r8zMultiCommand.get_commands "!r>cgS)zTReturns a list of subcommand names in the order they should appear. rvrs r<r6zMultiCommand.list_commandss  r>r.r(cddlmfdt||D}|t |||S)a0Return a list of completions for the incomplete value. Looks at the names of options, subcommands, and chained multi-commands. :param ctx: Invocation context for this command. :param incomplete: Value being completed. May be empty. .. versionadded:: 8.0 rr'cTg|]$\}}||%S)r2)r4)r5r;r5r(s r<rmz/MultiCommand.shell_complete..sH   g N4g&@&@&B&B C C C   r>)r7r(r=rrjr:)rr,r.r9r(r s @r<r:zMultiCommand.shell_completesw :99999    !;C!L!L    uww--c:>>???r>)NFNNFNF) rHrlrmrnrrr2rrrgr rrr-r rr rzrrr)rrr+rrfr0rr8r6r:rrs@r<r4r4s>2#!%',,0.2>B$$jo$!%$D) $ JsO $  $AJsAEz$:;$$ $$$$$$LAF3:,>$AF3K -'-m-------++t+ A368J++++Z-7-}-----8 g QVC[ QVC[      B''B'aeB'B'B'B'B'B'H88"#&+8 C!*W"5qvc{B C88886"w"#"!*W:M"""" QVC[ 'sqvFV?Wr>c eZdZUdZdZejejee d<dZ ejej ejdeje fe d< ddeje dejej eje efejefdejddffd Zdd edeje ddfd Zejd ejd ejfdefdZejdejdejdejejd ejfgeffdZdejdejdej ejejd ejfgefeffdZejd ejd ejfddfdZejdejdejdejejd ejfgdffdZdejdejdej ejejd ejfgdfdffdZdede dejefdZdedeje fdZxZS)GroupaMA group allows a command to have subcommands attached. This is the most common way to implement nesting in Click. :param name: The name of the group command. :param commands: A dict mapping names to :class:`Command` objects. Can also be a list of :class:`Command`, which will use :attr:`Command.name` to create the dict. :param attrs: Other command arguments described in :class:`MultiCommand`, :class:`Command`, and :class:`BaseCommand`. .. versionchanged:: 8.0 The ``commands`` argument can be a list of command objects. N command_class group_classr;rrr/c tj|fi||i}n&t|tjr d|D}||_dS)Nc,i|]}|j |j|SrNr)r5cs r< z"Group.__init__..&s#JJJaqv7I7I7I7Ir>)rjrrErr`r)rr;rrr s r<rzGroup.__init__sg '''''  HH #, / / KJJ8JJJH9A r>rAct|p|j}|tdt|||d||j|<dS)zRegisters another :class:`Command` with this group. If the name is not provided, the name of the command is used. NzCommand has no name.T)rB)r;rrJr)rrAr;s r< add_commandzGroup.add_command+sMsx <233 3D$d;;;;! dr> _Group__func.cdSrNrvrrs r<r5z Group.command5 r>rrcdSrNrvr^s r<r5z Group.command9rr>cXddlmd}r:tdr%tdkrr Jd\}djrd jd<dt jd t jfd tffd }| ||S|S) aA shortcut decorator for declaring and attaching a command to the group. This takes the same arguments as :func:`command` and immediately registers the created command with this group by calling :meth:`add_command`. To customize the command class used, set the :attr:`command_class` attribute. .. versionchanged:: 8.1 This decorator can be applied without parentheses. .. versionchanged:: 8.0 Added the :attr:`command_class` attribute. r )r5Nrz7Use 'command(**kwargs)(callable)' to provide arguments.rvclsr.r/cTi|}||SrNr)rrArr5rrs r<rz Group.command..decorator^s:377D3F33A66C   S ! ! !Jr>) decoratorsr5rrrrr2r rr0)rrrfuncrr5s``` @r<r5z Group.command?s" ('''''37  HT!W%% D QvH-GTD   /&**U"3"3"; .F5M CJ/ G           9T?? "r>cdSrNrvrs r<groupz Group.grouphrr>cdSrNrvr^s r<rz Group.grouplrr>cddlmd}r:tdr%tdkrr Jd\}dj@d+jt urt d<n jd<dtjd tj fd d ffd }| ||S|S) aA shortcut decorator for declaring and attaching a group to the group. This takes the same arguments as :func:`group` and immediately registers the created group with this group by calling :meth:`add_command`. To customize the group class used, set the :attr:`group_class` attribute. .. versionchanged:: 8.1 This decorator can be applied without parentheses. .. versionchanged:: 8.0 Added the :attr:`group_class` attribute. r )rNrz5Use 'group(**kwargs)(callable)' to provide arguments.rvrr.r/rcTi|}||SrNr)rrArrrrs r<rzGroup.group..decorators:////22C   S ! ! !Jr>) rrrrrrrGr2r r)rrrrrrs``` @r<rz Group.grouprs" &%%%%%37  HT!W%% D QvF-GTD   'FJJu,=,=,E4'' $T u $ 0u  CJ/ G           9T?? "r>r,r@c6|j|SrN)rrrs r<r8zGroup.get_commands}  ***r>c*t|jSrN)rhrrs r<r6zGroup.list_commandssdm$$$r>NNrN)rHrlrmrnrr2rrr0rrrrGrrr`rrrrr r5rr-r8r r6rrs@r<rrsx  (26M1:afWo.555GKKAGAF7OQVD\$ABCJJJ !%  AAjoA* GA$S'\2AJw4GG H A  A AAAAAA$""w"ajo"""""Z ajae4    Z Z U &'e QZQU +,g5 6   Z 'U'&'e' QZQU 34g=>G H''''RZ AJsAEz2 w   Z Z U &'e QZQU +,g5 6   Z *U*&'e* QZQU 34g=>G H****X+w+#+!*W:M++++%%QVC[%%%%%%%%r>rc eZdZdZ ddejedejejedej ddffd Z deddfd Z d e d edeje fd Zd e dejefd ZxZS)CommandCollectionakA command collection is a multi command that merges multiple multi commands together into one. This is a straightforward implementation that accepts a list of different multi commands as sources and provides all the commands for each of them. See :class:`MultiCommand` and :class:`Command` for the description of ``name`` and ``attrs``. Nr;sourcesrr/c Ntj|fi||pg|_dSrN)rjrr )rr;r rr s r<rzCommandCollection.__init__s3 '''''-4] r> multi_cmdc:|j|dS)z1Adds a new multi command to the chain dispatcher.N)r r)rr s r< add_sourcezCommandCollection.add_sources I&&&&&r>r,r@c|jD]6}|||}||jrt||||cS7dSrN)r r8rDrJ)rr,r@rrs r<r8zCommandCollection.get_commands^l  F##C22B~:<'h;;;  tr>ct}|jD]*}|||+t |SrN)rr rr6rh)rr,rrs r<r6zCommandCollection.list_commandssKl 1 1F IIf**3// 0 0 0 0bzzr>r)rHrlrmrnr2rrr r4rrrr-r0r8r6rrs@r<r r s !%48;;jo;AF<01; ;  ;;;;;;'L'T'''' w # !*W:M    QVC[r>r rcXt|trtt|S)ztCheck if the value is iterable but not a string. Raises a type error, or return an iterator over the value. )rErrrQ)rs r< _check_iterrs'% ;;r>ceZdZdZdZ d3dejejedejej e j ej fde d ejej ej ejgej ffd ejejedej gej fd ejed e d ejede de dejej eejefdejejedegej ejdejeffddfdZdejeej ffdZdefdZdejede dejejeejeejeffdZedefdZdefdZej d4dedddejej fdZej d5dede dejej ej ejgej fffd Z d4dede dejej ej ejgej fffd!Zd"ededdfd#Zded$ejeej fdejej e ffd%Z!ded&ej dej fd'Z"d&ej de fd(Z#ded&ej dej fd)Z$dedejefd*Z%dedejej fd+Z&ded$ejeej fd,ejedejej ejeffd-Z'dedejejeeffd.Z(dedejefd/Z)dedefd0Z*ded1edejdfd2Z+dS)6rTaA parameter to a command comes in two versions: they are either :class:`Option`\s or :class:`Argument`\s. Other subclasses are currently not supported by design as some of the internals for parsing are intentionally not finalized. Some settings are supported by both options and arguments. :param param_decls: the parameter declarations for this option or argument. This is a list of flags or argument names. :param type: the type that should be used. Either a :class:`ParamType` or a Python type. The latter is converted into the former automatically if supported. :param required: controls if this is optional or not. :param default: the default value if omitted. This can also be a callable, in which case it's invoked when the default is needed without any arguments. :param callback: A function to further process or validate the value after type conversion. It is called as ``f(ctx, param, value)`` and must return the value. It is called for all sources, including prompts. :param nargs: the number of arguments to match. If not ``1`` the return value is a tuple instead of single value. The default for nargs is ``1`` (except if the type is a tuple, then it's the arity of the tuple). If ``nargs=-1``, all remaining parameters are collected. :param metavar: how the value is represented in the help page. :param expose_value: if this is `True` then the value is passed onwards to the command callback and stored on the context, otherwise it's skipped. :param is_eager: eager values are processed before non eager ones. This should not be set for arguments or it will inverse the order of processing. :param envvar: a string or list of strings that are environment variables that should be checked. :param shell_complete: A function that returns custom shell completions. Used instead of the param's type completion if given. Takes ``ctx, param, incomplete`` and must return a list of :class:`~click.shell_completion.CompletionItem` or a list of strings. .. versionchanged:: 8.0 ``process_value`` validates required parameters and bounded ``nargs``, and invokes the parameter callback before returning the value. This allows the callback to validate prompts. ``full_process_value`` is removed. .. versionchanged:: 8.0 ``autocompletion`` is renamed to ``shell_complete`` and has new semantics described above. The old name is deprecated and will be removed in 8.1, until then it will be wrapped to match the new requirements. .. versionchanged:: 8.0 For ``multiple=True, nargs>1``, the default must be a list of tuples. .. versionchanged:: 8.0 Setting a default is no longer required for ``nargs>1``, it will default to ``None``. ``multiple=True`` or ``nargs=-1`` will default to ``()``. .. versionchanged:: 7.1 Empty environment variables are ignored rather than taking the empty string value. This makes it possible for scripts to clear variables if they can't unset them. .. versionchanged:: 2.0 Changed signature for parameter callback to also be passed the parameter. The old callback format will still work, but it will raise a warning to give you a chance to migrate the code easier. parameterNFT param_declsrGrdefaultrnargsrmetavarrraenvvarr:r(r/c |||||pd| \|_|_|_t j|||_||jjr |jj}nd}||_ ||_ ||_ ||_ | |_ ||_| |_||_| |_| |_ |jjr8||jjkr(t'd|jjd|jd|dt)|s|nd} | |r= t+t-| d} n#t.$rt'ddwxYw|dkro| o t-| n%#t.$r|rd }nd }t'|dwxYw|dkr5t1| |kr$|rd nd }t'd |d|ddSdSdSdSdS)Nrvr Tz'nargs' must be z (or None) for type z , but it was rWz1'default' must be a list when 'multiple' is true.zK'default' must be a list of lists when 'multiple' is true and 'nargs' != 1.z+'default' must be a list when 'nargs' != 1.z item lengthlengthz 'default' z must match nargs=) _parse_declsr;rrr convert_typerG is_compositearityrrrrrrrarr_custom_shell_completer_rnextrrr)rrrGrrrrrrrrarr: check_defaultrsubjects r<rzParameter.__init__(s( "  (484E4E  2|5 5 1 49d1&+%7g%F%F  =y%         (     &4#' y% %49?*B*B @ty@@!Y@@7<@@@ ,4G+<+<FGG$M($$(,[-G-G(N(N $$$$(O#$$ A::-"; <#M2222$ < < <#T!:$G 'TG(11t; <qyyS%7%75%@%@3;"I--(LLLELLL7)(:";";!y%@%@s D**EE!!"Fc |j|j|j|j|j|j|j|j|j |j d S)zGather information that could be useful for a tool generating user-facing documentation. Use :meth:`click.Context.to_info_dict` to traverse the entire CLI structure. .. versionadded:: 8.0 ) r;param_type_namerrrGrrrrr) r;r%rrrGrrrrrrrs r<rzParameter.to_info_dictsSI#3I"1I**,, Z |k   r>c2d|jjd|jdSrrrs r<r!zParameter.__repr__r"r>declsctrNr$)rr'rs r<rzParameter._parse_declss"###r>c|jS)zReturns the human readable name of this parameter. This is the same as the name for options, but the metavar for arguments. rrs r<human_readable_namezParameter.human_readable_names yr>c|j|jS|j|}||jj}|jdkr|dz }|S)Nr ...)rrG get_metavarr;rr)rrs r< make_metavarzParameter.make_metavars[ < #< )''-- ?in**,,G :?? u Gr>r,rrcdSrNrvrr,rs r<rzParameter.get_defaultrr>.cdSrNrvr0s r<rzParameter.get_defaultrr>c||jd}||j}|rt|r |}|S)aGet the default for the parameter. Tries :meth:`Context.lookup_default` first, then the local default. :param ctx: Current context. :param call: If the default is a callable, call it. Disable to return the callable instead. .. versionchanged:: 8.0.2 Type casting is no longer performed when getting a default. .. versionchanged:: 8.0.1 Type casting can fail in resilient parsing mode. Invalid defaults will not prevent showing help text. .. versionchanged:: 8.0 Looks at ``ctx.default_map`` first. .. versionchanged:: 8.0 Added the ``call`` parameter. Fr)rr;rr)rr,rrs r<rzParameter.get_defaultsO.""495"99 =LE  HUOO EGGE r>rctrNr$rrr,s r<rzParameter.add_to_parsers!###r>rc2||j}tj}|!||}tj}|&||j}tj}|!||}tj }||fSrN) rr;rkrqvalue_from_envvarrrrrtrrs)rr,rrrs r< consume_valuezParameter.consume_values## , =**3//E$0F =&&ty11E$0F =$$S))E$,Ff}r>rc |js jdkrdndSdtjdtjtjffd jdks jjr dtjdtjffd nLjdkr!dtjdtjffd n dtjdtjffd jr$tfd |DS|S) zuConvert and validate a value against the option's :attr:`type`, :attr:`multiple`, and :attr:`nargs`. Nrvrr/c t|S#t$r!ttddwxYw)NzValue must be an iterable.r,rS)rrrrrs r< check_iterz-Parameter.type_cast_value..check_iters] "5)))   #233D  s+=r c4|S)N)rSr,rGrs r<convertz*Parameter.type_cast_value..convert syydy<<cNtfd|DS)Nc3FK|]}|VdSrNr?r5xr,rs r<r6z=Parameter.type_cast_value..convert.. s3PPTYYq$44PPPPPPr>)tuplerr=r,rs r<r@z*Parameter.type_cast_value..convert s3PPPPPjj>O>OPPPPPPr>c Ft|}t|jkrUtt ddt|jt|tfd|DS)Nz%Takes {nargs} values but 1 was given.z*Takes {nargs} values but {len} were given.)rrr<c3FK|]}|VdSrNr?rCs r<r6z=Parameter.type_cast_value..convert..# s3DDTYYq$44DDDDDDr>)rErrrrrrFs r<r@z*Parameter.type_cast_value..convert sjj//00u::++& CHJJ!&tzs5zz&BB"DDDDDeDDDDDDr>c3.K|]}|VdSrNrv)r5rDr@s r<r6z,Parameter.type_cast_value..& s+????????r>)rrr2rrrGrrE)rr,rr=r@s`` @@r<rzParameter.type_cast_values =D$**:*:22 D ae  15(9        :??di4? =qu = = = = = = = = =Z2   Qqu Q Q Q Q Q Q Q Q Q Q  Equ E E E E E E E E E = @????ZZ->->????? ?wu~~r>cB|dS|jdks|jr|dkrdSdS)NTr rvF)rr)rrs r<value_is_missingzParameter.value_is_missing* s/ =4 J!OOt}O%2++4ur>c|||}|jr&||rt|||j||||}|S)Nr<)rrrKrr)rr,rs r< process_valuezParameter.process_value3 sk$$S%00 = 8T22599 8"s$777 7 = $MM#tU33E r>c|jdSt|jtr)tj|j}|r|Sn/|jD]'}tj|}|r|cS(dSrN)rrErrIrYr)rr,rrs r<resolve_envvar_valuezParameter.resolve_envvar_value> s ; 4 dk3 ' '  ,,B   +  Z^^F++IIItr>c~||}|%|jdkr|j|}|Sr)rOrrGsplit_envvar_value)rr,rs r<r7zParameter.value_from_envvarP s> $ 9 9# > > >djAoo--b11B r>rcTt||5|||\}}||j| |||}n#t $r |jsd}YnwxYwdddn #1swxYwY|jr||j|j<||fS)N)rS) rWr8rr;rM Exceptionrrr)rr,rrrrs r<rzParameter.handle_parse_resultX s"#T 2 2 2   ..sD99ME6  $ $TY 7 7 7 **366   ,                    *$)CJty !d{s55BABA63B5A66BB  B cdSrNrvrs r<rzParameter.get_help_recordl s r>cgSrNrvrs r<rzParameter.get_usage_pieceso s r>c^|jp|jg}dd|DS)z{Get a stringified version of the param for use in error messages to indicate which param caused the error.  / c3"K|] }d|dV dS)'Nrv)r5rDs r<r6z+Parameter.get_error_hint..w s*66q(a(((666666r>)rr*r)rr, hint_lists r<get_error_hintzParameter.get_error_hintr s7I;$":!; zz66I666666r>r.c$|jm||||}|r/t|dtrddlmfd|D}t jt jd|S|j |||S)aReturn a list of completions for the incomplete value. If a ``shell_complete`` function was given during init, it is used. Otherwise, the :attr:`type` :meth:`~click.types.ParamType.shell_complete` function is used. :param ctx: Invocation context for this command. :param incomplete: Value being completed. May be empty. .. versionadded:: 8.0 Nrr'c&g|] }|Srvrv)r5rr(s r<rmz,Parameter.shell_complete.. s#>>>>>!,,>>>r>r() r rErr7r(r2r3r rGr:r8s @r<r:zParameter.shell_completey s  & 211#tZHHG ?:gaj#66 ?AAAAAA>>>>g>>>6!&!12G<< <y''T:>>>r>) NNFNNNFNTFNNrr),rHrlrmrnr%r2rr`rrr ParamTyperrgr r-r r rr rr!rfrrr*r.rrrrMappingrkr8rrKrMrOr7rrrr[r:rvr>r<rTrTsGGR"O48<@EIQU!%#'!<@ %VVZ 30Vj!%!789V V AGAE1:b!%i+@$@AB V *QZ+qu(Equ(LMN Vz#VVCVVV 173 3#789V J+s+/0!&+=>@  V& 'VVVVp afS!%Z0    ,:#::::$Z_$48$ C!&+qvc{: ;$$$$ SX c    Z7;   "4 AE    Z Z),   "& AGAE1:b!%i#889 :   Z *."& AGAE1:b!%i#889 :B$L$w$4$$$$"#)CJ"7 ' ((171151QU1111fae   15    AJsO$WAE1B"#)CJ"7?@vc{ s # $( 7 qz!'#s(:K/L    Gs 7'7c7777?'?s?qvFV?W??????r>c%eZdZdZdZ d-dejejedej e edfdej e efd ej e efd e d e d eje d ejej de de de dejej e j ej fdejede de de dej ddf$fd Zdejeej fffd Zdejede dejejeejeejeffdZdededdfdZdedejejeeffd Zej d.ded!d"dejej fd#Zej d/ded!e dejej ej ejgej fffd%Z d.ded!e dejej ej ejgej ffffd& Zdedej fd'Zdedejeffd( Zdedejej fd)Zded*ejed+fdejej efffd, Z xZ!S)0ra Options are usually optional values on the command line and have some extra features that arguments don't have. All other parameters are passed onwards to the parameter constructor. :param show_default: Show the default value for this option in its help text. Values are not shown by default, unless :attr:`Context.show_default` is ``True``. If this value is a string, it shows that string in parentheses instead of the actual value. This is particularly useful for dynamic options. For single option boolean flags, the default remains hidden if its value is ``False``. :param show_envvar: Controls if an environment variable should be shown on the help page. Normally, environment variables are not shown. :param prompt: If set to ``True`` or a non empty string then the user will be prompted for input. If set to ``True`` the prompt will be the option name capitalized. :param confirmation_prompt: Prompt a second time to confirm the value if it was prompted for. Can be set to a string instead of ``True`` to customize the message. :param prompt_required: If set to ``False``, the user will be prompted for input only when the option was specified as a flag without a value. :param hide_input: If this is ``True`` then the input on the prompt will be hidden from the user. This is useful for password input. :param is_flag: forces this option to act as a flag. The default is auto detection. :param flag_value: which value should be used for this flag if it's enabled. This is set to a boolean automatically if the option string contains a slash to mark two options. :param multiple: if this is set to `True` then the argument is accepted multiple times and recorded. This is similar to ``nargs`` in how it works but supports arbitrary number of arguments. :param count: this flag makes an option increment an integer. :param allow_from_autoenv: if this is enabled then the value of this parameter will be pulled from an environment variable in case a prefix is defined on the context. :param help: the help string. :param hidden: hide this option from help outputs. :param attrs: Other command arguments described in :class:`Parameter`. .. versionchanged:: 8.1.0 Help text indentation is cleaned here instead of only in the ``@option`` decorator. .. versionchanged:: 8.1.0 The ``show_default`` parameter overrides ``Context.show_default``. .. versionchanged:: 8.1.0 The default of a single option boolean flag is not shown if the default value is ``False``. .. versionchanged:: 8.0.1 ``type`` is detected from ``flag_value`` if given. optionNFTrrrconfirmation_promptprompt_required hide_inputr flag_valuercountallow_from_autoenvrGr3r9 show_choices show_envvarrr/c | rtj| } d|v}tj|f| | d||durD|jt d|jdd}n |durd}n|}||_||_ ||_ ||_ ||_ |jduo|j |_ |$|d}n3|j rd}n)t|j}n|dur|j s |du|_ ||r|r|js| rd|_nd|_||j }||r| t%jd||_||_|ot-|jt$j|_||_| |_| r%| t%jd |_|rd |_| |_| |_||_||_||_ |j!d krt d |jr|jr|jst d |js|jrt d|jr|j r|jt d|jr,|j"rt d|jrt ddSdS)Nr)rGrTz&'name' is required with 'prompt=True'.rrFrvr)minr:z&nargs=-1 is not supported for options.z+'prompt' is not valid for non-boolean flag.z1Secondary flag is not valid for non-boolean flag.z9'prompt' with 'hide_input' is not valid for boolean flag.z%'count' is not valid with 'multiple'.z$'count' is not valid with 'is_flag'.)#rrrjrr;rr capitalizerrbrcrdr9rrgrrrr rrGrrE BoolParamType is_bool_flagrerfIntRangergr3rrhrirr)rrrrrbrcrdrrerrfrgrGr3r9rhrirdefault_is_missing prompt_textr s r<rzOption.__init__ s<(  *#D))D&e3L4(LLeLLL T>>y  HIII+/9+<+ct}||j|j|j|j|j|j|S)N)r3rrrerfr9) rjrrr3rrrerfr9)rrnr s r<rzOption.to_info_dictF s[GG((** ;L*;    r>r'rcg}g}d}g}|D]:}|r|td|d|}/|dddkrdnd}||vr||d\} } | } | r7|t | || | } | r'|| | | krtd|d|t |||<|c|ra|d |d d d d  }|sd}||sd||fStd |s|std|d|d|||fS)NzName 'z' defined twicer /;zBoolean option z) cannot use the same flag for true/false.c.t|d S)Nrr)rDs r<z%Option._parse_decls..t ss1Q4yyjr>rdrrrz#Could not determine name for optionz*No options defined but a name was passed (zH). Did you mean to declare an argument instead? Did you mean to pass '--z'?) isidentifierrsplitrsrrrr_sortrlower) rr'rrrr;possible_namesdecl split_charfirstseconds r<rzOption._parse_declsR s\ & &D  "" &##$BT$B$B$BCCC$(!HOOSS %%$(JJz1$=$=ME6!LLNNE+&--i.>.>??? E***#]]__F?&--fmmoo>>>(9d999' #)))D//:::KK%%%% 11ABB B N 1T11(,111  T>))r>rr,c|jrd}n |jrd}nd}|jr|d}|jrQ|jrJ|||j|j|d|||j|j|ddS|||j|j||jdS|||j|j||j dS) Nrrfstore_constT)r{rdestactionconstF)r{rrrr) rrfrrnr add_optionrr;rer)rrr,rs r<rzOption.add_to_parser s< = FF Z FFF < &&&F  T%8 !!4949VSW"!!,! "!!!/ "   YYj      r>c&jrdSddtjtdtffd }|jg}jr#||jjpd}g}jrj }|8j r1|j *j #|j dj }|lt|tr|ndd|D}|t!d | |j}d |_ |d } ||_n #||_wxYwd} d} j'tjtrd x} } nj} n|j|j} | s| r| | r d jd} nt| t*t,fr dd| D} nt/j| rt!d} n_jr6jr/t5jrjnjdd} n"jr js| sd} nt| } | r6|t!d| tjt:jrSjrjj dkr jj!0j"} | r|| j#r"|t!d|r%d|}|r|d|dnd|d}rdnd||fS)NFrr/ct|\}}|rdjs!js|dz }|S)NTr)rrrfr.)rr any_slashesany_prefix_is_slashrs r< _write_optsz+Option.get_help_record.._write_opts s[+400OB  +&*#< 0  0/$++--///Ir>rrz, c34K|]}t|VdSrNrr5ds r<r6z)Option.get_help_record.. s(":":a3q66":":":":":":r>zenv var: {var})varTr3()c34K|]}t|VdSrNrrs r<r6z)Option.get_help_record.. s(*I*Ia3q66*I*I*I*I*I*Ir>z (dynamic)rr zdefault: {default})rrz; z [][rW)$r9r2r`rrrrr3rirrgr|r;rrErrrrrrrOrEr isfunctionrnrrrGr _NumberRangeBaserfrkr_describe_ranger)rr,rrr3r'rvar_str resilient default_valuershow_default_is_strdefault_string range_str extra_strrs` @r<rzOption.get_help_record s5 ; 4# ajo #       k$)$$ %   8 IIkk$"566 7 7 7yB   F[F~+M.: - # 6LL9J9JLLF!"&#..;FF":":6":":":::  Q/0077G7DDEEE ) $ . ,,Su,==M$-C ! !IC ! - - - - #   ($+S11 1599#ll#0   )+L  U< U]5N" 4!9T%6!9!9!9MD%=99 4!%*I*I=*I*I*I!I!I#M22 4!";" 4t': 4"+"&,GTYYD4GK"""" 44+> 4} 4!#!$]!3!3 U Q344;;N;SSTTT ty%"8 9 9 (Z (%)IMQ$6$649=;P 1133I ( Y''' = ( LL: ' ' '  J %((I/3Id++y++++9IY9I9I9ID+6<E E&rrcdSrNrvr0s r<rzOption.get_default rr>.cdSrNrvr0s r<rzOption.get_default rr>c|jrP|jsI|jjD]:}|j|jkr(|jr!t jt|j cS;dSt ||S)Nr3) rrnr5rr;rr2r3rrerjr)rr,rrSr s r<rzOption.get_default& s <  1 + < <:**u}*6&%00;;;;4ww""3T"222r>c jJ}jrtj|Stj|jjjjfdS)zThis is an alternative flow that can be activated in the full value processing if a value does not exist. It will prompt the user until a valid value exists and then returns the processed value as result. Nc0|SrN)rM)rDr,rs r<rwz)Option.prompt_for_value..M s!3!3C!;!;r>)rrGrdrhrb value_proc)rrrnrrGrdrhrb)rr,rs`` r<prompt_for_valuezOption.prompt_for_value6 s {&&&""3''   14;00 0 K* $ 8;;;;;    r>ct|}||S|jrT|jM|jF|jd|j}t j|}|r|SdS)Nr) rjrOrgr|r;rrIrYr)rr,rrr s r<rOzOption.resolve_envvar_valueP s WW ) )# . . >I  # &2 %.DD1B1BDDF''B  tr>c||}|dS|jdkt|jz}|dkrA|j|}|jr |jdkrt ||j}|Sr)rOrrgrrGrQrR)rr,r value_depths r<r7zOption.value_from_envvarc s $ 9 9# > > :4zQ$t}*=*== ??--b11B} +q2tz** r>rrTct||\}}|turDj)|js"|}t j}nj}t j }nj r6|4td|Drfd|D}t j }nM|dt j hvr=j6j sjr(|js!|}t j}||fS)Nc3(K|] }|tuVdSrNr)r5vs r<r6z'Option.consume_value.. s(::qA**::::::r>c4g|]}|turjn|Srv)rre)r5rrs r<rmz(Option.consume_value.. s*UUU!->(>(>T__AUUUr>)rjr8rrrrrkrurerqranyrsrrc)rr,rrrr s` r<r8zOption.consume_values s*--c488 v % % %{&s/D&--c22(/(4 M ,!::E:::::"VUUUuUUUE$0FF t_45 5 5 '("&"6()())#..E$+Ff}r>)NNFFTFNNFFTNNFTFrr)"rHrlrmrnr%r2rr`rrrgrr r^rr rrfr rrr-rrrrr rrOr7r_rkr8rrs@r<rr s::xO4815%*27 $ $((,#'<@ $!!#tLtLZ 30tLgdCo.tLc " tL WT3Y/ tL  tLtLD!tLJqu%tLtLtL!tLj!%!789tLjotLtL !tL"#tL$%tL& 'tLtLtLtLtLtLl afS!%Z0      3*Z_3*483* C!&+qvc{: ;3*3*3*3*j%L%w%4%%%%NjG7jGqz!'#s(:K/LjGjGjGjGXZ7;   "4 AE    Z Z),   "& AGAE1:b!%i#889 :   Z *.333"&3 AGAE1:b!%i#889 :333333  G     4AJsO&WAE1B ##"#)C,<"=# ' (##########r>rc leZdZdZdZ ddejedeje dej ddffd Z e defd Z defd Zd ejed e dejejeejeejeffd ZdedejefdZdedefdZdededdfdZxZS)raArguments are positional parameters to a command. They generally provide fewer features than options but can have infinite ``nargs`` and are required by default. All parameters are passed onwards to the constructor of :class:`Parameter`. argumentNrrrr/c |2|dd}n|dddk}d|vrtdtj|fd|i| |j|jd krtd dSdS) NrFrr rrz9__init__() got an unexpected keyword argument 'multiple'.rTr:z('default' is not supported for nargs=-1.)rrrjrrr)rrrrr s r<rzArgument.__init__ s  yy##/  99Wa0014   WXX XAAxA5AAA L|'DJ",<,< JKKK(',<,cP|j|jS|jSrN)rr;rrs r<r*zArgument.human_readable_name s$ < #< y   r>c|j|jS|j|}|s|j}|jsd|d}|jdkr|dz }|S)Nrrr r,)rrGr-r;rrr)rrs r<r.zArgument.make_metavar sp < #< i##D)) $)//##C} c***C :?? 5LC r>r'rc |s|sdggfStdt|dkr3|dx}}|dd}n tdt|d||ggfS)Nz%Could not determine name for argumentr rrrz6Arguments take exactly one parameter declaration, got rW)rrrr{)rr'rr;args r<rzArgument._parse_decls s E $R|#CDD D u::??q !D3<<S))//11DD"JJ""" cUBr>r,c,|gSrNr.rs r<rzArgument.get_usage_pieces s!!##$$r>c2d|dS)NrYrrs r<r[zArgument.get_error_hint s)4$$&&))))r>rcJ||j|j|dS)N)rrr{) add_argumentr;rr5s r<rzArgument.add_to_parser s'$*$GGGGGr>rN)rHrlrmrnr%r2r`rrrgrrrr*r.rfr rr-rr[rrrrs@r<rr s!O &*LLZ_L*T"L L  LLLLLL*!S!!!X! c    Z_48 C!&+qvc{: ;"%G%s %%%%*'*c****HLHwH4HHHHHHHHr>rrrN)VrorQrrIrGtypingr2 collectionsr contextlibrr functoolsrrrr itertoolsr r r r exceptionsrrrrrr formattingrrglobalsrrrrrrtermuirrr utilsr!r"r#r$r%r& TYPE_CHECKINGtyping_extensionsterZr(TypeVarr rr)r+rrrfr=rgrJIterabler r rRrrWr`riEnumrkr-rr0r4rr rrTrrrvr>r<rsP  %%%%%% $$$$$$ $$$$$$&&&&&&((((((""""""%%%%%%$$$$$$ !!!!!!%%%%%% ''''''******%%%%%%?1""""000000 AIcCJ/000 AIcNN$ $ #$ZY'($$$$(SX ,/6?KO 0:AJqM:s:qvagafo7N::::59 :k2Z$3j-3z+.3VK3333(AAAAAdiAAA4_ 0_ 0_ 0_ 0_ 0_ 0_ 0_ 0DC*C*C*C*C*C*C*C*L uuuuukuuup rrrrr7rrrj m%m%m%m%m%Lm%m%m%`***** ***ZquAE!2r?r?r?r?r?r?r?r?j EEEEEYEEEPIHIHIHIHIHyIHIHIHIHIHr>