1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
U
Þ=®dÏã@s²ddlZejrddlmZGdd„deƒZGdd„deeeƒZ    Gdd    „d    e    ƒZ
Gd
d „d eƒZ Gd 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__©úHd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\jinja2/exceptions.pyr
 
szTemplateError.__init__©rcCs|jr|jdSdS)Nr)Úargs©r rrrr szTemplateError.message)N) Ú__name__Ú
__module__Ú __qualname__Ú__doc__ÚtÚOptionalÚstrr
ÚpropertyrÚ __classcell__rrr rrsrc@s\eZdZUdZdZejeed<d ejej    edfejeddœdd„Z
edœd    d
„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.
    Nrr)ÚnamerrcCsNt ||¡|dkr6ddlm}t||ƒr2| ¡|}||_||_|g|_dS)Nrr)    ÚIOErrorr
ÚruntimerÚ
isinstanceZ_fail_with_undefined_errorrrÚ    templates)r rrrrrrr
s  
zTemplateNotFound.__init__rcCs
t|jƒSr)rrrrrrÚ__str__1szTemplateNotFound.__str__)N) rrrrrrrrÚ__annotations__ÚUnionr
r"rrrrrs
    ýü 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†|dkr^ddlm}g}|D]&}t||ƒr8| |j¡q| |¡qd tt|ƒ¡}d|›}tƒ     |rp|dnd|¡t
|ƒ|_ dS)Nrrz, z(none of the templates given were found: éÿÿÿÿ) rrr ÚappendZ_undefined_messageÚjoinÚmaprr    r
Úlistr!)r r&rrÚpartsrZ    parts_strr rrr
As 
 
zTemplatesNotFound.__init__)rN) rrrrrÚSequencer$rrr
rrrr rr%5s ýür%csReZdZdZd eeejeejeddœ‡fdd„ Zedœdd„Z    d    d
„Z
‡Z S) ÚTemplateSyntaxErrorzBRaised to tell the user that there is a problem with the template.N)rÚlinenorÚfilenamercs.tƒ |¡||_||_||_d|_d|_dS)NF)r    r
r/rr0ÚsourceÚ
translated)r rr/rr0r rrr
[s  zTemplateSyntaxError.__init__rcCsª|jrt t|j¡Sd|j›}|jp*|j}|r@d|›d|›}t t|j¡d|g}|jdk    r z|j     ¡|jd}Wnt
k
rŒYnX|  d|  ¡¡d  |¡S)Nzline zFile "z", z  rz    Ú
)r2rÚcastrrr/r0rr1Ú
splitlinesÚ
IndexErrorr(Ústripr))r ÚlocationrÚlinesÚlinerrrr"ls  
zTemplateSyntaxError.__str__cCs|j|j|j|j|jffSr)r rr/rr0rrrrÚ
__reduce__ƒszTemplateSyntaxError.__reduce__)NN) rrrrrÚintrrr
r"r;rrrr rr.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©rrrrrrrrr=‹sr=c@seZdZdZdS)ÚTemplateRuntimeErrorzoA generic runtime error in the template engine.  Under some situations
    Jinja may raise this exception.
    Nr>rrrrr?“sr?c@seZdZdZdS)ÚUndefinedErrorz<Raised if a template tries to operate on :class:`Undefined`.Nr>rrrrr@™sr@c@seZdZdZdS)Ú SecurityErrorzWRaised if a template tries to do something insecure if the
    sandbox is enabled.
    Nr>rrrrrAsrAc@seZdZdZdS)ÚFilterArgumentErrorzQThis error is raised if a filter was called with inappropriate
    arguments
    Nr>rrrrrB£srB)ÚtypingrÚ TYPE_CHECKINGrrÚ    ExceptionrrÚ LookupErrorrr%r.r=r?r@rArBrrrrÚ<module>s  ##3