U a@sddlZddlZddlmZejr6ddlZddlmZeZ ej ddddd d Z ej de ej ddd d Z de ej ddd d Z dddddZddddZdej e ej e dddZdS)N)local)ContextFzte.Literal[False]r)silentreturncCsdSNrrrNC:\Users\vtejo\AppData\Local\Temp\pip-unpacked-wheel-s9fh6ldx\click\globals.pyget_current_context sr .cCsdSrrr rrr r sc Cs>ztdtjdWSttfk r8|s4tdYnXdS)aReturns the current click context. This can be used as a way to access the current context object from anywhere. This is a more implicit alternative to the :func:`pass_context` decorator. This function is primarily useful for helpers such as :func:`echo` which might be interested in changing its behavior based on the current context. To push the current context, :meth:`Context.scope` can be used. .. versionadded:: 5.0 :param silent: if set to `True` the return value is `None` if no context is available. The default behavior is to raise a :exc:`RuntimeError`. rz!There is no active click context.N)tcast_localstackAttributeError IndexError RuntimeErrorr rrr r s )ctxrcCstjdg|dS)z*Pushes a new context to the current stack.rN)r__dict__ setdefaultappend)rrrr push_context.sr)rcCstjdS)z%Removes the top level from the stack.N)rrpoprrrr pop_context3sr)colorrcCs(|dk r |Stdd}|dk r$|jSdS)zInternal helper to get the default value of the color flag. If a value is passed it's returned unchanged, otherwise it's looked up from the current context. NTr )r r)rrrrr resolve_color_default8s  r)F).)F)N)typingr threadingr TYPE_CHECKINGZtyping_extensionstecorerroverloadr boolOptionalrrrrrrr s