3

U'ícÏã@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ƒj|ƒdS)N)ÚsuperÚ__init__)Úselfr)Ú	__class__©ú3/tmp/pip-build-gk9425m9/Jinja2/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@sXeZdZUdZdZejed
ejejedfejeddœ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)ÚnamerrcCsNtj||ƒ|dkr6ddlm}t||ƒr2|jƒ|}||_||_|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ÚUnionrrrrrrrs

rcsFeZdZdZfdfejejedfejeddœ‡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)ÚnamesrrcsŠ|dkrbddlm}g}x.|D]&}t||ƒr:|j|jƒq|j|ƒqWdjtt|ƒƒ}d|›}tƒj	|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__)rrrrrÚSequencerrrrrrr)r
rr5s
rcsReZdZdZdeeejeejeddœ‡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ƒj|ƒ||_||_||_d|_d|_dS)NF)rrr)rr*ÚsourceÚ
translated)r	rr)rr*)r
rrr[szTemplateSyntaxError.__init__)rcCsª|jrtjt|jƒSd|j›}|jp*|j}|r@d|›d|›}tjt|jƒd|g}|jdk	r y|jj	ƒ|jd}Wnt
k
rŒYnX|jd|jƒƒdj
|ƒ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Úintrrrrr5rrr)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r7‹sr7c@seZdZdZdS)ÚTemplateRuntimeErrorzoA generic runtime error in the template engine.  Under some situations
    Jinja may raise this exception.
    N)rrrrrrrrr8“sr8c@seZdZdZdS)ÚUndefinedErrorz<Raised if a template tries to operate on :class:`Undefined`.N)rrrrrrrrr9™sr9c@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ÚLookupErrorrrr(r7r8r9r:r;rrrrÚ<module>s##3