/usr/local/lib/python3.6/site-packages/jinja2/__pycache__
Edit: /usr/local/lib/python3.6/site-packages/jinja2/__pycache__/exceptions.cpython-36.pyc (5498B)
3
^TBg @ s d dl ZejrddlmZ G dd deZG dd deeeZ G dd d e Z
G d
d deZG dd
d
eZG dd deZ
G dd de
ZG dd de
ZG dd de
ZdS ) N ) Undefinedc sH e Zd ZdZd eje dd fdd
Zeeje dddZ Z
S )
TemplateErrorz"Baseclass for all template errors.N)messagereturnc s t j| d S )N)super__init__)selfr ) __class__ 3/tmp/pip-build-0s3hx122/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__tOptionalstrr propertyr
__classcell__r r )r
r r s r c @ sX e Zd ZU dZdZeje d
ejejedf eje ddddZ eddd Z
dS )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 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 | jS )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_messagejoinmapr 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
ZedddZ 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| jS d| j }| jp*| j}|r@d| d| }tjt| jd| g}| jd k ry| 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" stripr# )r locationr linesliner r r r l s
zTemplateSyntaxError.__str__c C s | j | j| j| j| jffS )N)r
r r) r r* )r r r r
__reduce__ s zTemplateSyntaxError.__reduce__)NN)r r r r r intr r r r r5 r r r )r
r r( X s r( c @ s e Zd ZdZdS )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 r7 s r7 c @ s e Zd ZdZdS )TemplateRuntimeErrorzoA generic runtime error in the template engine. Under some situations
Jinja may raise this exception.
N)r r r r r r r r r8 s r8 c @ s e Zd ZdZdS )UndefinedErrorz