|
Server : Apache System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : matalashes ( 1004) PHP Version : 8.1.29 Disable Function : NONE Directory : /usr/local/lib64/python3.6/site-packages/jinja2/__pycache__/ |
Upload File : |
3
E�Kd� � @ s� d dl ZejrddlmZ G dd� de�ZG dd� deee�Z G dd � d e �Z
G d
d� de�ZG dd
� d
e�ZG dd� de�Z
G dd� de
�ZG dd� de
�ZG dd� de
�ZdS )� N� )� Undefinedc sH e Zd ZdZd eje dd�� fdd�
Zeeje d�dd��Z � Z
S )
�
TemplateErrorz"Baseclass for all template errors.N)�message�returnc s t � j|� d S )N)�super�__init__)�selfr )� __class__� �3/tmp/pip-build-8nxjc3nm/jinja2/jinja2/exceptions.pyr
s zTemplateError.__init__)r c C s | j r| j d S d S )Nr )�args)r r r r r
s zTemplateError.message)N)�__name__�
__module__�__qualname__�__doc__�t�Optional�strr �propertyr �
__classcell__r r )r
r r s r c @ sX e Zd ZU dZdZeje d
ejejedf eje dd�dd�Z ed�dd �Z
dS )�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 )�namer r c C sN t j| |� |d kr6ddlm} t||�r2|j� |}|| _|| _|g| _d S )Nr )r ) �IOErrorr �runtimer �
isinstanceZ_fail_with_undefined_errorr r � templates)r r r r r r r r s
zTemplateNotFound.__init__)r c C s
t | j�S )N)r r )r r r r �__str__1 s zTemplateNotFound.__str__)N)r r r r r r r r �Unionr r r r r r r s
r c sF e Zd ZdZf dfejejedf eje dd�� 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
Nr )�namesr r c s� |d krbddl m} g }x.|D ]&}t||�r:|j|j� q|j|� qW djtt|��}d|� �}t� j |rt|d nd |� 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 Z parts_str)r
r r r A s
zTemplatesNotFound.__init__)r r r r r �Sequencer r r r r r r )r
r r 5 s
r c sR e Zd ZdZdeeeje eje dd�� fdd�
Zed�dd�Z d d
� Z
� ZS )�TemplateSyntaxErrorzBRaised to tell the user that there is a problem with the template.N)r �linenor �filenamer c s. t � j|� || _|| _|| _d | _d| _d S )NF)r r r) r r* �source�
translated)r r r) r r* )r
r r r [ s zTemplateSyntaxError.__init__)r c C s� | j rtjt| j�S d| j� �}| jp*| j}|r@d|� d|� �}tjt| j�d| g}| jd k r�y| jj � | jd }W n t
k
r� Y nX |jd|j� � dj
|�S )Nzline zFile "z", z r z �
)r, r �castr r r) r* r r+ �
splitlines�
IndexErrorr"