
    /h                        d dl mZ d dlZd dlmZ ej        rddlmZ  e            Z	ej
        ddd            Zej
        ddd            ZdddZddZddZdddZdS )     )annotationsN)local   )ContextFsilentt.Literal[False]returnr   c                    d S N r   s    @/var/www/html/venv/lib/python3.11/site-packages/click/globals.pyget_current_contextr      s    FIc    .boolContext | Nonec                    d S r   r   r   s    r   r   r      s    ?Bsr   c                    	 t          j        dt          j        d                   S # t          t
          f$ r}| st          d          |Y d}~nd}~ww xY wdS )a  Returns 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`.
    r   z!There is no active click context.N)tcast_localstackAttributeError
IndexErrorRuntimeError)r   es     r   r   r      s    Kvib!1222J' K K K 	KBCCJ	K 	K 	K 	K 	KK 4s   $' AAActxNonec                l    t           j                            dg                               |            dS )z*Pushes a new context to the current stack.r   N)r   __dict__
setdefaultappend)r   s    r   push_contextr$   ,   s.    
Ow++22377777r   c                 B    t           j                                         dS )z%Removes the top level from the stack.N)r   r   popr   r   r   pop_contextr'   1   s    
Lr   colorbool | Nonec                @    | | S t          d          }||j        S dS )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(   )r(   r   s     r   resolve_color_defaultr+   6   s1    
 
T
*
*
*C
y4r   )F)r   r   r	   r   ).)r   r   r	   r   )r   r   r	   r   )r	   r   r   )r(   r)   r	   r)   )
__future__r   typingr   	threadingr   TYPE_CHECKINGcorer   r   overloadr   r$   r'   r+   r   r   r   <module>r2      s    " " " " " "          ? 	  I I I I  I  B B B B  B    08 8 8 8
   
      r   