jfIr ddlZddlZddlZddlmZddlmZddlm Z ddlm Z ddlm Z ddlm Z dd lm Z dd lmZdd lmZdd lmZejrddlZejd ZejdZejdZejdejfZejdejee fZdCdZ dDdZ! dEdej"ede#dejdgdffdZ$ddd e%d!ej&e%dd"fd#Z'ejd$e Z(ej)d%ede fd&Z*ej)d%ej&e%d'ej"e(d(ejdejege(ffd)Z*ej) dFd%dd'ej"e(d(ejdejege(ffd*Z*ej) dGd%ej&e%d'dd(ejdejege ffd+Z* dHd%ejej&e%efd'ej&ej"e(d(ejdeje ejegeje e(ffffd,Z*ejd-e Z+ej)d%ede fd.Z,ej)d%ej&e%d'ej"e+d(ejdejege+ffd/Z,ej) dFd%dd'ej"e+d(ejdejege+ffd0Z,ej) dGd%ej&e%d'dd(ejdejege ffd1Z, dHd%eje%edfd'ej&ej"e+d(ejdeje ejegeje e+ffffd2Z,dejdejfd3eddfd4Z-dd5d6e%d'ej&ej"e d(ejdejegeffd7Z.dd5d6e%d'ej&ej"e d(ejdejegeffd8Z/d6e%d9ejdejegeffd:Z0d6e%d9ejdejegeffd;Z1 dFdddd<d=ej&e%d6e%d>ej&e%d?ej&e%d@ej&e%d9ejdejegeffdAZ2d6e%d9ejdejegeffdBZ3dS)INupdate_wrapper)gettext)Argument)Command)Context)Group)Option) Parameterget_current_context)echoPRT.FC)boundf)t.Callable[te.Concatenate[Context, P], R]returnt.Callable[P, R]c0dfd }t|S) z]Marks a callback as wanting to receive the current context object as first argument. argsP.argskwargsP.kwargsrrc4tg|Ri|SNr rrrs p/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/click/decorators.pynew_funczpass_context..new_func s*q$&&8888888rrrrrrrrr"s` r! pass_contextr&s3 999999 (A & &&r#'t.Callable[te.Concatenate[t.Any, P], R]c0dfd }t|S) zSimilar to :func:`pass_context`, but only pass the object on the context onwards (:attr:`Context.obj`). This is useful if that object represents the state of a nested system. rrrrrrc>tjg|Ri|Sr)robjr s r!r"zpass_obj..new_func,s-q$&&*.decorator..new_funcLs%''C 3'' 44ook22{"!'2';!!! 3:a6t666v66 6r#r$r)rr"r-r,s` r! decoratorz&make_pass_decorator..decoratorKs> 7 7 7 7 7 7 7 7$h***r#)rr.rr)r,r-r8s`` r!make_pass_decoratorr:2s/2+++++++* r#)doc_descriptionkeyr;zGt.Callable[[t.Callable[te.Concatenate[t.Any, P], R]], t.Callable[P, R]]c:d fd }|dd}d |d |_|S) a{Create a decorator that passes a key from :attr:`click.Context.meta` as the first argument to the decorated function. :param key: Key in ``Context.meta`` to pass. :param doc_description: Description of the object being passed, inserted into the decorator's docstring. Defaults to "the 'key' key from Context.meta". .. versionadded:: 8.0 rr'rrcJdddddtffd }t|S)Nrrrrrc^t}|j}|j|g|Ri|Sr)rmetar6)rrr7r*rr<s r!r"z2pass_meta_key..decorator..new_funcss=%''C(3-C3:a6t666v66 6r#)rr)rr"r<s` r!r8z pass_meta_key..decoratorrsN 7H 7  7q 7 7 7 7 7 7 7 h***r#Nzthe z$ key from :attr:`click.Context.meta`zDecorator that passes z1 as the first argument to the decorated function.rr'rr)__doc__)r<r;r8s` r! pass_meta_keyrCcs_++++++LLLL & & & & r#CmdTypenamecdSrr9rEs r!commandrHCr#clsattrsc dSrr9rErJrKs r!rHrH Cr#c dSrr9rMs r!rHrH Cr#c dSrr9rMs r!rHrH Cr#c d}tr}d Jdr Jd/tjtjtt dt dtffd }| ||S|S)aCreates a new :class:`Command` and uses the decorated function as callback. This will also automatically attach all decorated :func:`option`\s and :func:`argument`\s as parameters to the command. The name of the command defaults to the name of the function with underscores replaced by dashes. If you want to change that, you can pass the intended name as the first argument. All keyword arguments are forwarded to the underlying command class. For the ``params`` argument, any decorated params are appended to the end of the list. Once decorated the function turns into a :class:`Command` instance that can be invoked as a command line utility or be attached to a command :class:`Group`. :param name: the name of the command. This defaults to the function name with underscores replaced by dashes. :param cls: the command class to instantiate. This defaults to :class:`Command`. .. versionchanged:: 8.1 This decorator can be applied without parentheses. .. versionchanged:: 8.1 The ``params`` argument can be used. Decorated params are appended to the end of the list. Nz4Use 'command(cls=cls)(callable)' to specify a class.z7Use 'command(**kwargs)(callable)' to provide arguments.rrc t|trtddd}||ng} |j}|`|t |n#t$rYnwxYwd |j d<tj rJtrJdp,|j dd||d}|j |_ |S)Nz5Attempted to convert a callback into a command twice.paramshelp_-)rEcallbackrUr9) isinstancer TypeErrorpop__click_params__extendreversedAttributeErrorgetrBt TYPE_CHECKINGcallabler5lowerreplace)r attr_paramsrUdecorator_paramscmdrKrJrEs r!r8zcommand..decoratorsA a ! ! USTT Tii$// + 7R 6 1 " MM(#344 5 5 5 5     D  99V   $IE&M ? &???~~ % %%c =))++33C==      i  sA// A<;A<)rdrbcastTyperDr _AnyCallable)rErJrKfuncr8s``` r!rHrHsD;?D~~T{{R{{{SSSSSy {fQVG_g..\g> y r#GrpTypecdSrr9rGs r!grouprprIr#c dSrr9rMs r!rprprNr#c dSrr9rMs r!rprprPr#c dSrr9rMs r!rprprRr#c |/tjtjtt}t |rt dd|i||St ||fi|S)aCreates a new :class:`Group` with a function as callback. This works otherwise the same as :func:`command` just that the `cls` parameter is set to :class:`Group`. .. versionchanged:: 8.1 This decorator can be applied without parentheses. NrJr9)rbrjrkrnr rdrHrMs r!rprp$si {fQVG_e,,~~/(w((3(%((... 4 & & & &&r#paramct|tr|j|dSt |dsg|_|j|dS)Nr])rZrrUappendhasattrr])rrus r! _param_memory9sf!W) q,-- $!#A  !!%(((((r#)rJ param_declscJtdtdtffd }|S)aAttaches an argument to the command. All positional arguments are passed as parameter declarations to :class:`Argument`; all keyword arguments are forwarded unchanged (except ``cls``). This is equivalent to creating an :class:`Argument` instance manually and attaching it to the :attr:`Command.params` list. For the default argument class, refer to :class:`Argument` and :class:`Parameter` for descriptions of parameters. :param cls: the argument class to instantiate. This defaults to :class:`Argument`. :param param_decls: Passed as positional arguments to the constructor of ``cls``. :param attrs: Passed as keyword arguments to the constructor of ``cls``. Nrrc6t|fi|SrryrrKrJrzs r!r8zargument..decoratorX*Ass;00%00111r#)rrrJrzrKr8s``` r!argumentrCsO$ {RB r#cJtdtdtffd }|S)aAttaches an option to the command. All positional arguments are passed as parameter declarations to :class:`Option`; all keyword arguments are forwarded unchanged (except ``cls``). This is equivalent to creating an :class:`Option` instance manually and attaching it to the :attr:`Command.params` list. For the default option class, refer to :class:`Option` and :class:`Parameter` for descriptions of parameters. :param cls: the option class to instantiate. This defaults to :class:`Option`. :param param_decls: Passed as positional arguments to the constructor of ``cls``. :param attrs: Passed as keyword arguments to the constructor of ``cls``. Nrrc6t|fi|Srr}r~s r!r8zoption..decoratortrr#)r rrs``` r!optionr_sO$ {RB r#rc4dtdtdtddfd}|sd}|dd |d ||d d |d d|ddt |i|S)a-Add a ``--yes`` option which shows a prompt before continuing if not passed. If the prompt is declined, the program will exit. :param param_decls: One or more option names. Defaults to the single value ``"--yes"``. :param kwargs: Extra arguments are passed to :func:`option`. r7ruvaluerNc6|s|dSdSr)abortr7rurs r!rYz%confirmation_option..callbacks%  IIKKKKK  r#)z--yesis_flagTrY expose_valueFpromptzDo you want to continue?rVz%Confirm the action without prompting.)r r bool setdefaultrrzrrYs r!confirmation_optionr{sgi !  i&&& j(+++ ne,,, h :;;; fEFFF ; )& ) ))r#c|sd}|dd|dd|ddt|i|S)a0Add a ``--password`` option which prompts for a password, hiding input and asking to enter the value again for confirmation. :param param_decls: One or more option names. Defaults to the single value ``"--password"``. :param kwargs: Extra arguments are passed to :func:`option`. )z --passwordrTconfirmation_prompt hide_input)rr)rzrs r!password_optionrsg &%  h%%% +T222 lD))) ; )& ) ))r#) package_name prog_namemessageversionrrrcZtd{ytj}||jnd}||jnd}~|M|ddkr|drdddtd td td dffd } |sd }| dd| dd| dd| dtd| |d<t|i|S)aAdd a ``--version`` option which immediately prints the version number and exits the program. If ``version`` is not provided, Click will try to detect it using :func:`importlib.metadata.version` to get the version for the ``package_name``. On Python < 3.8, the ``importlib_metadata`` backport must be installed. If ``package_name`` is not provided, Click will try to detect it by inspecting the stack frames. This will be used to detect the version, so it must match the name of the installed package. :param version: The version number to show. If not provided, Click will try to detect it. :param param_decls: One or more option names. Defaults to the single value ``"--version"``. :param package_name: The package name to detect the version from. If not provided, Click will try to detect it. :param prog_name: The name of the CLI to show in the message. If not provided, it will be detected from the command. :param message: The message to show. The values ``%(prog)s``, ``%(package)s``, and ``%(version)s`` are available. Defaults to ``"%(prog)s, version %(version)s"``. :param kwargs: Extra arguments are passed to :func:`option`. :raise RuntimeError: ``version`` could not be detected. .. versionchanged:: 8.0 Add the ``package_name`` parameter, and the ``%(package)s`` value for messages. .. versionchanged:: 8.0 Use :mod:`importlib.metadata` instead of ``pkg_resources``. The version is detected based on the package name, not the entry point name. The Python package name must match the installed package name, or be passed with ``package_name=``. Nz%(prog)s, version %(version)sr5__main__ __package__.rr7rurrc|r|jrdS|jVT ddlm}n#t $rddl}YnwxYw |n!#|j$rtddwxYwtddtdz|j | dS)Nr)metadataz6 is not installed. Try passing 'package_name' instead.z$Could not determine the version for z automatically.)progpackagercolor) resilient_parsing find_root info_name importlibr ImportErrorimportlib_metadatarPackageNotFoundErrorr4rrexit)r7rurrrrrrs r!rYz version_option..callbacksN -  F   1I ?|7 6....... 6 6 6555555 6 "**<880   "#///  ?V|VVV  y\gVV V)      s4AA AA=)z --versionrTrFis_eagerrVzShow the version and exit.rY) rWinspect currentframef_back f_globalsra partitionr r rrr) rrrrrzrframerrrYs ```` r!version_optionrsX344</$&&!&!2(.(:F$$    $==44Lz))(}}];;  >+55c::1= $g$i$$$$$$$$$$$L %$  i&&& ne,,, j$''' fa <==>>>!F: ; )& ) ))r#c,dtdtdtddfd}|sd}|dd |d d |d d |d t d||d<t |i|S)aAdd a ``--help`` option which immediately prints the help page and exits the program. This is usually unnecessary, as the ``--help`` option is added to each command automatically unless ``add_help_option=False`` is passed. :param param_decls: One or more option names. Defaults to the single value ``"--help"``. :param kwargs: Extra arguments are passed to :func:`option`. r7rurrNc|r|jrdSt||j|dS)Nr)rrget_helprrrs r!rYzhelp_option..callback"sG -  F S\\^^39----  r#)z--helprTrFrrVzShow this message and exit.rY)r r rrrWrrs r! help_optionrsgi "!  i&&& ne,,, j$''' fa =>>???!F: ; )& ) ))r#)rrrrrA)Fr).N)NN)4rtypestypingrb functoolsrrrWcorerrr r r r globalsrutilsrrctyping_extensionste ParamSpecrTypeVarrrCallableAnyrlUnionrr&r+rkrr:strOptionalrCrDoverloadrHrnrpryrrrrrrr9r#r!rsY $$$$$$ ((((((?"""" SA AIcNN AIcNNz#qu*% QYt17<#89:::'''' ' ' ' ',1...$(.Z679KKL....d59 "#*S/NB !)IW - - -,7   *S/ UZ'(    U  Z'(  -1 *S/&*<=EZ'( 48'+OO '!*S/</ 0O AF7O $OUOWWaj,'9I1J!JK KL OOOOd !)IU + + +    *S/ UZ'(    U  Z'(  -1 *S/&*<=EZ%& .2'+'' '#|T) *' AF7O $'U'WUAJ ~qwug~/FFG GH ''''*)1:c15j))))))))<@Jqvh'78JK%Zb::>Jqvf~6HIZb8*c*QU*qz2$PR(?S****0*#**1:rdBh;O****$ $n*%)!%# n*n*n* Z_n*n**S/n*z# n* Z_ n* e n*Zbn*n*n*n*b*c*QU*qz2$(7K******r#