a
    sZŽhÏ  ã                   @   s²   d dl ZejrddlmZ G dd„ deƒZG dd„ deeeƒZ	G dd	„ d	e	ƒZ
G d
d„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZdS )é    Né   ©Ú	Undefinedc                       sH   e Zd ZdZd	eje ddœ‡ fdd„Zeeje dœdd„ƒZ	‡  Z
S )
ÚTemplateErrorz"Baseclass for all template errors.N)ÚmessageÚreturnc                    s   t ƒ  |¡ d S ©N)ÚsuperÚ__init__)Úselfr   ©Ú	__class__© ú@/var/www/auris/lib/python3.10/site-packages/jinja2/exceptions.pyr
   
   s    zTemplateError.__init__©r   c                 C   s   | j r| j d S d S )Nr   )Úargs©r   r   r   r   r      s    zTemplateError.message)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚtÚOptionalÚstrr
   Úpropertyr   Ú__classcell__r   r   r   r   r      s   r   c                   @   s\   e Zd ZU dZdZeje ed< dejej	edf  eje ddœdd„Z
edœd	d
„ZdS )ÚTemplateNotFoundzÀRaised 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   r   )Únamer   r   c                 C   sN   t  | |¡ |d u r6ddlm} t||ƒr2| ¡  |}|| _|| _|g| _d S )Nr   r   )	ÚIOErrorr
   Úruntimer   Ú
isinstanceÚ_fail_with_undefined_errorr   r   Ú	templates)r   r   r   r   r   r   r   r
      s    
zTemplateNotFound.__init__r   c                 C   s
   t | jƒS r   )r   r   r   r   r   r   Ú__str__1   s    zTemplateNotFound.__str__)N)r   r   r   r   r   r   r   r   Ú__annotations__ÚUnionr
   r#   r   r   r   r   r      s   
	 ýür   c                       sB   e Zd ZdZdejejedf  eje ddœ‡ fdd„Z	‡  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   Nr   )Únamesr   r   c                    s†   |d u r^ddl m} g }|D ]&}t||ƒr8| |j¡ q| |¡ qd tt|ƒ¡}d|› }tƒ  	|rp|d nd |¡ t
|ƒ| _d S )Nr   r   z, z(none of the templates given were found: éÿÿÿÿ)r   r   r    ÚappendZ_undefined_messageÚjoinÚmapr   r	   r
   Úlistr"   )r   r'   r   r   Úpartsr   Ú	parts_strr   r   r   r
   A   s    

zTemplatesNotFound.__init__)r   N)r   r   r   r   r   ÚSequencer%   r   r   r
   r   r   r   r   r   r&   5   s     ýür&   c                       sR   e Zd ZdZdeeeje eje ddœ‡ fdd„Zedœdd„Z	d	d
„ Z
‡  ZS )ÚTemplateSyntaxErrorzBRaised to tell the user that there is a problem with the template.N)r   Úlinenor   Úfilenamer   c                    s.   t ƒ  |¡ || _|| _|| _d | _d| _d S )NF)r	   r
   r1   r   r2   ÚsourceÚ
translated)r   r   r1   r   r2   r   r   r   r
   [   s    zTemplateSyntaxError.__init__r   c                 C   s¨   | j rt t| j¡S d| j› }| jp*| j}|r@d|› d|› }t t| j¡d| g}| jd uržz| j 	¡ | jd  }W n t
yŠ   Y n0 | d| ¡  ¡ d |¡S )Nzline zFile "z", z  r   z    Ú
)r4   r   Úcastr   r   r1   r2   r   r3   Ú
splitlinesÚ
IndexErrorr)   Ústripr*   )r   Úlocationr   ÚlinesÚliner   r   r   r#   l   s    
zTemplateSyntaxError.__str__c                 C   s   | j | j| j| j| jffS r   )r   r   r1   r   r2   r   r   r   r   Ú
__reduce__ƒ   s    zTemplateSyntaxError.__reduce__)NN)r   r   r   r   r   Úintr   r   r
   r#   r=   r   r   r   r   r   r0   X   s     ûúr0   c                   @   s   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   r   r?   ‹   s   r?   c                   @   s   e Zd ZdZdS )ÚTemplateRuntimeErrorzoA generic runtime error in the template engine.  Under some situations
    Jinja may raise this exception.
    Nr@   r   r   r   r   rA   “   s   rA   c                   @   s   e Zd ZdZdS )ÚUndefinedErrorz<Raised if a template tries to operate on :class:`Undefined`.Nr@   r   r   r   r   rB   ™   s   rB   c                   @   s   e Zd ZdZdS )ÚSecurityErrorzWRaised if a template tries to do something insecure if the
    sandbox is enabled.
    Nr@   r   r   r   r   rC      s   rC   c                   @   s   e Zd ZdZdS )ÚFilterArgumentErrorzQThis error is raised if a filter was called with inappropriate
    arguments
    Nr@   r   r   r   r   rD   £   s   rD   )Útypingr   ÚTYPE_CHECKINGr   r   Ú	Exceptionr   r   ÚLookupErrorr   r&   r0   r?   rA   rB   rC   rD   r   r   r   r   Ú<module>   s   ##3