
    /h                     (   d dl Zej        rddlmZ  G d de          Z G d deee          Z	 G d d	e	          Z
 G d
 de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          ZdS )    N   	Undefinedc                   v     e Zd ZdZddej        e         ddf fdZedej        e         fd            Z	 xZ
S )TemplateErrorz"Baseclass for all template errors.Nmessagereturnc                 J    t                                          |           d S N)super__init__)selfr   	__class__s     D/var/www/html/venv/lib/python3.11/site-packages/jinja2/exceptions.pyr   zTemplateError.__init__
   s!    !!!!!    c                 .    | j         r| j         d         nd S )Nr   )argsr   s    r   r   zTemplateError.message   s    #y2ty||d2r   r   )__name__
__module____qualname____doc__tOptionalstrr   propertyr   __classcell__r   s   @r   r   r      s        ,," "
3 "4 " " " " " " 3C 3 3 3 X3 3 3 3 3r   r   c                       e Zd ZU dZdZej        e         ed<   	 d	dej        ej	        edf                  dej        e         ddfdZ
defdZdS )
TemplateNotFoundzRaised if a template does not exist.

    .. versionchanged:: 2.11
        If the given name is :class:`Undefined` and no message was
        provided, an :exc:`UndefinedError` is raised.
    Nr   namer   r	   c                     t                               | |           |,ddlm} t	          ||          r|                                 |}|| _        || _        |g| _        d S )Nr   r   )	IOErrorr   runtimer   
isinstance_fail_with_undefined_errorr   r!   	templates)r   r!   r   r   s       r   r   zTemplateNotFound.__init__   su    
 	t$$$?******$	** 2//111G	r   c                 *    t          | j                  S r   )r   r   r   s    r   __str__zTemplateNotFound.__str__1   s    4<   r   r   )r   r   r   r   r   r   r   r   __annotations__Unionr   r)    r   r   r    r       s            $GQZ_###
 $(   jk!123  C  
	       &! ! ! ! ! ! !r   r    c                   |     e Zd ZdZ	 	 d	dej        ej        edf                  dej        e         ddf fdZ	 xZ
S )
TemplatesNotFounda  Like :class:`TemplateNotFound` but raised if multiple templates
    are selected.  This is a subclass of :class:`TemplateNotFound`
    exception, so just catching the base exception will catch both.

    .. versionchanged:: 2.11
        If a name in the list of names is :class:`Undefined`, a message
        about it being undefined is shown rather than the empty string.

    .. versionadded:: 2.2
    r,   Nnamesr   r   r	   c                    |zddl m} g }|D ]B}t          ||          r|                    |j                   -|                    |           Cd                    t          t          |                    }d| }t                      	                    |r|d         nd |           t          |          | _        d S )Nr   r   z, z(none of the templates given were found: )r$   r   r%   append_undefined_messagejoinmapr   r   r   listr'   )r   r/   r   r   partsr!   	parts_strr   s          r   r   zTemplatesNotFound.__init__A   s    
 ?******E ' 'dI.. 'LL!89999LL&&&&		#c5//22ILLLGe5rw???er   )r,   N)r   r   r   r   r   Sequencer+   r   r   r   r   r   s   @r   r.   r.   5   s        	 	 8:#'% %z!'#{"234% C% 
	% % % % % % % % % %r   r.   c                   |     e Zd ZdZ	 	 ddededej        e         dej        e         ddf
 fdZdefd	Z	d
 Z
 xZS )TemplateSyntaxErrorzBRaised to tell the user that there is a problem with the template.Nr   linenor!   filenamer	   c                     t                                          |           || _        || _        || _        d | _        d| _        d S )NF)r   r   r<   r!   r=   source
translated)r   r   r<   r!   r=   r   s        r   r   zTemplateSyntaxError.__init__[   sF     	!!!	 '+  r   c                    | j         rt          j        t          | j                  S d| j         }| j        p| j        }|rd| d| }t          j        t          | j                  d|z   g}| j        c	 | j        	                                | j        dz
           }|
                    d|                                z              n# t          $ r Y nw xY wd                    |          S )Nzline zFile "z", z  r   z    
)r@   r   castr   r   r<   r=   r!   r?   
splitlinesr2   strip
IndexErrorr4   )r   locationr!   lineslines        r   r)   zTemplateSyntaxError.__str__l   s    ? 	-6#t|,,, )4;((})	 	433333HT\**D8O< ;"4{--//a@ Vdjjll23333    
 yys   5'C 
CCc                 D    | j         | j        | j        | j        | j        ffS r   )r   r   r<   r!   r=   r   s    r   
__reduce__zTemplateSyntaxError.__reduce__   s"    
 ~dk49dmTTTr   )NN)r   r   r   r   r   intr   r   r   r)   rK   r   r   s   @r   r;   r;   X   s        LL !%$(       jo	 
 *S/  
           "         .U U U U U U Ur   r;   c                       e Zd ZdZdS )TemplateAssertionErrora  Like a template syntax error, but covers cases where something in the
    template caused an error at compile time that wasn't necessarily caused
    by a syntax error.  However it's a direct subclass of
    :exc:`TemplateSyntaxError` and has the same attributes.
    Nr   r   r   r   r,   r   r   rN   rN      s           r   rN   c                       e Zd ZdZdS )TemplateRuntimeErrorzoA generic runtime error in the template engine.  Under some situations
    Jinja may raise this exception.
    NrO   r,   r   r   rQ   rQ                 r   rQ   c                       e Zd ZdZdS )UndefinedErrorz<Raised if a template tries to operate on :class:`Undefined`.NrO   r,   r   r   rT   rT      s        FFFFr   rT   c                       e Zd ZdZdS )SecurityErrorzWRaised if a template tries to do something insecure if the
    sandbox is enabled.
    NrO   r,   r   r   rV   rV      rR   r   rV   c                       e Zd ZdZdS )FilterArgumentErrorzQThis error is raised if a filter was called with inappropriate
    arguments
    NrO   r,   r   r   rX   rX      rR   r   rX   )typingr   TYPE_CHECKINGr$   r   	Exceptionr   r#   LookupErrorr    r.   r;   rN   rQ   rT   rV   rX   r,   r   r   <module>r]      s      ? #""""""3 3 3 3 3I 3 3 3 !  !  !  !  !w]  !  !  !F %  %  %  %  %(  %  %  %F0U 0U 0U 0U 0U- 0U 0U 0Uf    0       =   G G G G G) G G G    (       .     r   