Your IP : 3.138.120.112


Current Path : /opt/alt/python37/lib/python3.7/site-packages/jinja2/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/jinja2/__pycache__/exceptions.cpython-37.opt-1.pyc

B

�:�`��@s�ddlZejrddlmZGdd�de�ZGdd�deee�Z	Gdd	�d	e	�Z
Gd
d�de�ZGdd
�d
e�ZGdd�de�Z
Gdd�de
�ZGdd�de
�ZGdd�de
�ZdS)�N�)�	UndefinedcsHeZdZdZd	ejedd��fdd�
Zeejed�dd��Z	�Z
S)
�
TemplateErrorz"Baseclass for all template errors.N)�message�returncst��|�dS)N)�super�__init__)�selfr)�	__class__��B/opt/alt/python37/lib/python3.7/site-packages/jinja2/exceptions.pyr
szTemplateError.__init__)rcCs|jr|jdSdS)Nr)�args)r	rrrr
szTemplateError.message)N)�__name__�
__module__�__qualname__�__doc__�t�Optional�strr�propertyr�
__classcell__rr)r
rrsrc@s\eZdZUdZdZejeed<dejej	edfejedd�dd�Z
ed�d	d
�ZdS)�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.
    Nrr)�namerrcCsNt�||�|dkr6ddlm}t||�r2|��|}||_||_|g|_dS)Nr)r)	�IOErrorr�runtimer�
isinstanceZ_fail_with_undefined_errorrr�	templates)r	rrrrrrrs
zTemplateNotFound.__init__)rcCs
t|j�S)N)rr)r	rrr�__str__1szTemplateNotFound.__str__)N)rrrrrrrr�__annotations__�Unionrrrrrrrs

rcsBeZdZdZdejejedfejedd��fdd�
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
    rNr)�namesrrcs�|dkrbddlm}g}x.|D]&}t||�r:|�|j�q|�|�qWd�tt|��}d|��}t��	|rt|dnd|�t
|�|_dS)Nr)rz, z(none of the templates given were found: ���)rrr�appendZ_undefined_message�join�maprrr�listr)r	r!rr�partsrZ	parts_str)r
rrrAs


zTemplatesNotFound.__init__)rN)rrrrr�Sequencerrrrrrr)r
rr 5s
r csReZdZdZdeeejeejedd��fdd�
Zed�dd�Z	d	d
�Z
�ZS)�TemplateSyntaxErrorzBRaised to tell the user that there is a problem with the template.N)r�linenor�filenamercs.t��|�||_||_||_d|_d|_dS)NF)rrr*rr+�source�
translated)r	rr*rr+)r
rrr[szTemplateSyntaxError.__init__)rcCs�|jrt�t|j�Sd|j��}|jp*|j}|r@d|�d|��}t�t|j�d|g}|jdk	r�y|j�	�|jd}Wnt
k
r�YnX|�d|���d�
|�S)Nzline zFile "z", z  rz    �
)r-r�castrrr*r+rr,�
splitlines�
IndexErrorr#�stripr$)r	�locationr�lines�linerrrrls
zTemplateSyntaxError.__str__cCs|j|j|j|j|jffS)N)r
rr*rr+)r	rrr�
__reduce__�szTemplateSyntaxError.__reduce__)NN)rrrrr�intrrrrr6rrr)r
rr)Xsr)c@seZdZdZdS)�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)rrrrrrrrr8�sr8c@seZdZdZdS)�TemplateRuntimeErrorzoA generic runtime error in the template engine.  Under some situations
    Jinja may raise this exception.
    N)rrrrrrrrr9�sr9c@seZdZdZdS)�UndefinedErrorz<Raised if a template tries to operate on :class:`Undefined`.N)rrrrrrrrr:�sr:c@seZdZdZdS)�
SecurityErrorzWRaised if a template tries to do something insecure if the
    sandbox is enabled.
    N)rrrrrrrrr;�sr;c@seZdZdZdS)�FilterArgumentErrorzQThis error is raised if a filter was called with inappropriate
    arguments
    N)rrrrrrrrr<�sr<)�typingrZ
TYPE_CHECKINGrr�	Exceptionrr�LookupErrorrr r)r8r9r:r;r<rrrr�<module>s##3

?>