ó œÃÒYc@sddlZddlZddlmZddlmZddlmZddlm Z ddl m Z d„Z d „Z ed „Zd „Zddd „Zdd „Zd„Zd„Zd„Zd„Zd„Zdd„Zd„ZddlmZmZmZmZdS(iÿÿÿÿN(tupdate_wrapperi(t iteritems(t_check_for_unicode_literals(techo(tget_current_contextcs‡fd†}t|ˆƒS(s]Marks a callback as wanting to receive the current context object as first argument. csˆtƒ||ŽS(N(R(targstkwargs(tf(sc/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/click/click/decorators.pytnew_funcs(R(RR((Rsc/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/click/click/decorators.pyt pass_context scs‡fd†}t|ˆƒS(s¼Similar 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. csˆtƒj||ŽS(N(Rtobj(RR(R(sc/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/click/click/decorators.pyRs(R(RR((Rsc/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/click/click/decorators.pytpass_objscs‡‡fd†}|S(s.Given an object type this creates a decorator that will work similar to :func:`pass_obj` but instead of passing the object of the current context, it will find the innermost context of type :func:`object_type`. This generates a decorator that works roughly like this:: from functools import update_wrapper def decorator(f): @pass_context def new_func(ctx, *args, **kwargs): obj = ctx.find_object(object_type) return ctx.invoke(f, obj, *args, **kwargs) return update_wrapper(new_func, f) return decorator :param object_type: the type of the object to pass. :param ensure: if set to `True`, a new object will be created and remembered on the context if it's not there yet. cs"‡‡‡fd†}t|ˆƒS(Ncsltƒ}ˆr!|jˆƒ}n|jˆƒ}|dkrRtdˆjƒ‚n|jˆ||d|ŽS(NsGManaged to invoke callback without a context object of type %r existingi(Rt ensure_objectt find_objecttNonet RuntimeErrort__name__tinvoke(RRtctxR (tensureRt object_type(sc/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/click/click/decorators.pyR6s  (R(RR(RR(Rsc/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/click/click/decorators.pyt decorator5s ((RRR((RRsc/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/click/click/decorators.pytmake_pass_decorators cCsît|tƒrtdƒ‚ny|j}|jƒ|`Wntk rTg}nX|jdƒ}|dkr£tj |ƒ}t|t ƒr²|j dƒ}q²ntj |ƒ}||dRKtverRQtdisttscriptst script_namet entry_point(RItmoduleRHRL(sc/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/click/click/decorators.pyRós0         R?R@tis_eagerRsShow the version and exit.Rs --version(s --version(R5RR.RBRCR<(RR(R(R\R8RL(RIRHsc/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/click/click/decorators.pyRïs N(Rtsyst _getframet f_globalsR!(RLR8R(R((R(R\R8RLsc/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/click/click/decorators.pytversion_optionás %cs‡‡fd†}|S(slAdds a ``--help`` option which immediately ends the program printing out the help page. This is usually unnecessary to add as this is added by default to all commands unless suppressed. Like :func:`version_option`, this is implemented as eager option that prints in the callback and exits. All arguments are forwarded to :func:`option`. csld„}ˆjdtƒˆjdtƒˆjddƒˆjdtƒ|ˆd((sc/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/click/click/decorators.pyR"sR?R@RsShow this message and exit.R]Rs--help(s--help(R.RBRCR<(RR(R(R8(sc/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/click/click/decorators.pyR!s  ((R8R(R((R(R8sc/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/click/click/decorators.pyt help_options  (RR/R6R:( R^R"t functoolsRt_compatRt _unicodefunRtutilsRtglobalsRR R RCRR*RR-R0R4R9R<RDRGRaRctcoreRR/R6R:(((sc/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/click/click/decorators.pyts(   &      6