Files
pyGoEdge-UserPanel/.venv/Lib/site-packages/django/template/__pycache__/base.cpython-312.pyc

334 lines
44 KiB
Plaintext
Raw Normal View History

2025-11-18 03:36:49 +08:00
<EFBFBD>
j<> i*<2A><00><00>`<00>dZddlZddlZddlZddlmZddlmZddlm Z ddl
m Z ddl m Z ddlmZmZmZdd lmZmZmZdd
lmZdd lmZmZd d lmZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(ejRd<1A>Z*ejVd<1B>Z,Gd<1C>de<05>Z-Gd<1E>de.<2E>Z/Gd <20>d!<21>Z0Gd"<22>d#<23>Z1d$<24>Z2Gd%<25>d&<26>Z3Gd'<27>d(<28>Z4Gd)<29>d*e4<65>Z5Gd+<2B>d,<2C>Z6d-d.d/ejnd0<64>ejnd1<64>d2<64>zZ8e8jsd3d4<64>Z8d5e8d6d7ejne<1D>ejne<1E>d8<64>zZ:e e:ejv<00>Z<Gd9<64>d:<3A>Z=Gd;<3B>d<<3C>Z>Gd=<3D>d><3E>Z?Gd?<3F>d@e@<40>ZAGdA<64>dBe?<3F>ZBdC<64>ZCGdD<64>dEe?<3F>ZDe dF<64>ZEdHdG<64>ZFy)Ia<49>
This is the Django template system.
How it works:
The Lexer.tokenize() method converts a template string (i.e., a string
containing markup with custom template tags) to tokens, which can be either
plain text (TokenType.TEXT), variables (TokenType.VAR), or block statements
(TokenType.BLOCK).
The Parser() class takes a list of tokens in its constructor, and its parse()
method returns a compiled template -- which is, under the hood, a list of
Node objects.
Each Node is responsible for creating some sort of output -- e.g. simple text
(TextNode), variable values in a given context (VariableNode), results of basic
logic (IfNode), results of looping (ForNode), or anything else. The core Node
types are TextNode, VariableNode, IfNode and ForNode, but plugin modules can
define their own custom node types.
Each Node has a render() method, which takes a Context and returns a string of
the rendered node. For example, the render() method of a Variable Node returns
the variable's value as a string. The render() method of a ForNode returns the
rendered output of whatever was inside the loop, recursively.
The Template class is a convenient wrapper that takes care of template
compilation and rendering.
Usage:
The only thing you should ever use directly in this file is the Template class.
Create a compiled template object with a template_string, then call render()
with a context. In the compilation stage, the TemplateSyntaxError exception
will be raised if the template doesn't have proper syntax.
Sample code:
>>> from django import template
>>> s = '<html>{% if test %}<h1>{{ varvalue }}</h1>{% endif %}</html>'
>>> t = template.Template(s)
(t is now a compiled template, and its render() method can be called multiple
times with multiple contexts)
>>> c = template.Context({'test':True, 'varvalue': 'Hello'})
>>> t.render(c)
'<html><h1>Hello</h1></html>'
>>> c = template.Context({'test':False, 'varvalue': 'Hello'})
>>> t.render(c)
'<html></html>'
<EFBFBD>N)<01>Enum)<01> BaseContext)<01>localize)<01>conditional_escape)<01>_lazy_re_compile)<03>SafeData<74>
SafeString<EFBFBD> mark_safe)<03> get_text_list<73> smart_split<69>unescape_string_literal)<01>template_localtime)<02> gettext_lazy<7A> pgettext_lazy<7A>)<01>TemplateSyntaxError<6F>|<7C>:<3A>.z{%z%}z{{z}}z{#z#}<7D>{<7B>}z<unknown source>z({%.*?%}|{{.*?}}|{#.*?#})zdjango.templatec<00><00>eZdZdZdZdZdZy)<06> TokenTyperr<00><00>N)<07>__name__<5F>
__module__<EFBFBD> __qualname__<5F>TEXT<58>VAR<41>BLOCK<43>COMMENT<4E><00><00>CE:\Project\pygoedge\.venv\Lib\site-packages\django/template/base.pyrr^s<00><00> <0C>D<EFBFBD>
<0B>C<EFBFBD> <0A>E<EFBFBD><0F>Gr$rc<00><00>eZdZdd<01>Zd<02>Zy)<05>VariableDoesNotExistc<00> <00>||_||_y<00>N<><02>msg<73>params)<03>selfr+r,s r%<00>__init__zVariableDoesNotExist.__init__fs<00><00><16><04><08><1C><04> r$c<00>4<00>|j|jzSr)r*<00>r-s r%<00>__str__zVariableDoesNotExist.__str__js<00><00><13>x<EFBFBD>x<EFBFBD>$<24>+<2B>+<2B>%<25>%r$N)r#)rrrr.r1r#r$r%r'r'es <00><00><1D>&r$r'c<00>6<00>eZdZdd<02>Zd<03>Zd<04>Zd<05>Zed<06><00>Zy)<08>OriginNc<00>.<00>||_||_||_yr))<03>name<6D> template_name<6D>loader)r-r5r6r7s r%r.zOrigin.__init__os<00><00><18><04> <09>*<2A><04><1A><1C><04> r$c<00><00>|jSr))r5r0s r%r1zOrigin.__str__ts <00><00><13>y<EFBFBD>y<EFBFBD>r$c<00>P<00>d|jj<00>d|j<00>d<03>S)N<><z name=<3D>>)<03> __class__rr5r0s r%<00>__repr__zOrigin.__repr__ws<00><00>!%<25><1E><1E>!<<3C>!<<3C>d<EFBFBD>i<EFBFBD>i<EFBFBD>H<>Hr$c<00><><00>t|t<00>xr4|j|jk(xr|j|jk(Sr))<04>
isinstancer3r5r7)r-<00>others r%<00>__eq__z Origin.__eq__zs;<00><00> <16>u<EFBFBD>f<EFBFBD> %<25> ,<2C><14> <09> <09>U<EFBFBD>Z<EFBFBD>Z<EFBFBD>'<27> ,<2C><14> <0B> <0B>u<EFBFBD>|<7C>|<7C>+<2B>
r$c<00><><00>|jr9|jj<00>d|jjj<00><01>Sy)Nr)r7rr<rr0s r%<00> loader_namezOrigin.loader_name<6D>s8<00><00> <0F>;<3B>;<3B><14> <0B> <0B>&<26>&<26><14> <0B> <0B>%<25>%<25>.<2E>.<2E><0E> <0E> r$<00>NN) rrrr.r1r=rA<00>propertyrCr#r$r%r3r3ns+<00><00><1D>
<19>I<01>
<EFBFBD><0E><0E><0E>r$r3c<00>2<00>eZdZdd<02>Zd<03>Zd<04>Zd<05>Zd<06>Zd<07>Zy) <09>TemplateNc<00><><00>|<04>ddlm}|j<00>}|<02>tt<00>}||_||_||_t|<01>|_|j<00>|_
y)Nr)<01>Engine) <0B>enginerI<00> get_defaultr3<00>UNKNOWN_SOURCEr5<00>origin<69>str<74>source<63>compile_nodelist<73>nodelist)r-<00>template_stringrMr5rJrIs r%r.zTemplate.__init__<5F>sZ<00><00>
<12>><3E> &<26><1B>'<27>'<27>)<29>F<EFBFBD> <11>><3E><1B>N<EFBFBD>+<2B>F<EFBFBD><18><04> <09><1C><04> <0B><1C><04> <0B><19>/<2F>*<2A><04> <0B><1C>-<2D>-<2D>/<2F><04> r$c<00>v<00>d|jj<00>d|jddjdd<05><00>d<06>S)Nr:<00> template_string="<22><00>
<EFBFBD><00>...">)r<rrO<00>replacer0s r%r=zTemplate.__repr__<5F>s4<00><00> <10>N<EFBFBD>N<EFBFBD> '<27> '<27> <10>K<EFBFBD>K<EFBFBD><03><12> <1C> $<24> $<24>T<EFBFBD>2<EFBFBD> .<2E>
<EFBFBD>
r$c<00>8<00>|jj|<01>Sr))rQ<00>render<65>r-<00>contexts r%<00>_renderzTemplate._render<65>s<00><00><13>}<7D>}<7D>#<23>#<23>G<EFBFBD>,<2C>,r$c<00>V<00>|jj|<00>5|j<00>F|j|<00>5|j|_|j |<01>cddd<01>cddd<01>S|j |<01>cddd<01>S#1swYnxYw ddd<01>y#1swYyxYw)z)Display stage -- can be called many timesN)<07>render_context<78>
push_state<EFBFBD>template<74> bind_templater5r6r^r\s r%r[zTemplate.render<65>s<><00><00> <14> #<23> #<23> .<2E> .<2E>t<EFBFBD> 4<><16><1F><1F>'<27><1C>*<2A>*<2A>4<EFBFBD>0<>,0<>I<EFBFBD>I<EFBFBD>G<EFBFBD>)<29><1F><<3C><<3C><07>0<>1<>0<>5<> 4<> <1C>|<7C>|<7C>G<EFBFBD>,<2C> 5<> 4<>0<>0<><30>0<>5<> 4<> 4<>s(<00>B<03>"B <05> B<03>/B<03> B <09>B<03>B(c<00><><00>|jjrt|j<00>}nt |j<00>}|j <00>}t ||jj|jj|j<00>} |j<00>}|j|_ |S#t$r=}|jjr!|j||j<00>|_<00>d}~wwxYw)z<>
Parse and compile the template source into a nodelist. If debug
is True and an exception occurs during parsing, the exception is
annotated with contextual line information where it occurred in the
template source.
N)rJ<00>debug<75>
DebugLexerrO<00>Lexer<65>tokenize<7A>Parser<65>template_libraries<65>template_builtinsrM<00>parse<73>
extra_data<EFBFBD> Exception<6F>get_exception_info<66>token<65>template_debug)r-<00>lexer<65>tokens<6E>parserrQ<00>es r%rPzTemplate.compile_nodelist<73>s<><00><00> <10>;<3B>;<3B> <1C> <1C><1E>t<EFBFBD>{<7B>{<7B>+<2B>E<EFBFBD><19>$<24>+<2B>+<2B>&<26>E<EFBFBD><16><1E><1E>!<21><06><17> <12> <10>K<EFBFBD>K<EFBFBD> *<2A> *<2A> <10>K<EFBFBD>K<EFBFBD> )<29> )<29> <10>K<EFBFBD>K<EFBFBD> 
<EFBFBD><06> <12><1D>|<7C>|<7C>~<7E>H<EFBFBD>$<24>/<2F>/<2F>D<EFBFBD>O<EFBFBD><1B>O<EFBFBD><4F><18> <12><13>{<7B>{<7B> <20> <20>#'<27>#:<3A>#:<3A>1<EFBFBD>a<EFBFBD>g<EFBFBD>g<EFBFBD>#F<><01> <20> <11><> <12>s<00>"B6<00>6 C<<03>?8C7<03>7C<c <00>B<00>|j\}}d}d}d}g}dx} x}
} tt|j<00><00>D]`\} } ||k\r4|| kr/| }|j||} |j||}
|j|| } |j | |j|| f<02>| }<07>bt |<08>}t d||z
<00>}t||dz|z<00>} t|jd<00>}||||| |
| |||||jj||d<06> S#ttf$rd}Y<00>9wxYw)a:
Return a dictionary containing contextual line information of where
the exception occurred in the template. The following information is
provided:
message
The message of the exception raised.
source_lines
The lines before, after, and including the line the exception
occurred on.
line
The line number the exception occurred on.
before, during, after
The line the exception occurred on split into three parts:
1. The content before the token that raised the error.
2. The token that raised the error.
3. The content after the token that raised the error.
total
The number of lines in source_lines.
top
The line number where source_lines starts.
bottom
The line number where source_lines ends.
start
The start position of the token in the template source.
end
The end position of the token in the template source.
<20>
rrWrz!(Could not get exception message)) <0C>message<67> source_lines<65>before<72>during<6E>after<65>top<6F>bottom<6F>total<61>liner5<00>start<72>end)<0E>position<6F> enumerate<74>linebreak_iterrO<00>append<6E>len<65>max<61>minrN<00>args<67>
IndexError<EFBFBD>UnicodeDecodeErrorrMr5)r-<00> exceptionrpr<>r<><00> context_linesr<73><00>uptoryrzr{r|<00>num<75>nextrr}r~rxs r%rozTemplate.get_exception_info<66>s^<00><00>J<1B>^<5E>^<5E>
<EFBFBD><05>s<EFBFBD><1A> <0A><10><04><10><04><19> <0C>"$<24>$<24><06>$<24><16>%<25>"<22>><3E>$<24>+<2B>+<2B>#><3E>?<3F>I<EFBFBD>C<EFBFBD><14><14><04>}<7D><13><04><1B><1A><04><1D><1B><1B>T<EFBFBD>%<25>0<><06><1D><1B><1B>U<EFBFBD>3<EFBFBD>/<2F><06><1C> <0B> <0B>C<EFBFBD><04>-<2D><05> <18> <1F> <1F><13>d<EFBFBD>k<EFBFBD>k<EFBFBD>$<24>t<EFBFBD>&<<3C> =<3D> ><3E><17>D<EFBFBD>@<01><14>L<EFBFBD>!<21><05><11>!<21>T<EFBFBD>M<EFBFBD>)<29>*<2A><03><14>U<EFBFBD>D<EFBFBD>1<EFBFBD>H<EFBFBD>}<7D>4<>5<><06> :<3A><19>)<29>.<2E>.<2E><11>+<2B>,<2C>G<EFBFBD>
<1F>(<28><13>V<EFBFBD>4<><1C><1C><1A><16><1C><1A><18><18>K<EFBFBD>K<EFBFBD>$<24>$<24><1A><16> 
<EFBFBD>
<EFBFBD><EFBFBD><1B>.<2E>/<2F> :<3A>9<>G<EFBFBD> :<3A>s<00> D
<00>
D<03>D<03>NNN) rrrr.r=r^r[rPror#r$r%rGrG<00>s!<00><00>0<>"
<EFBFBD> -<2D>-<2D><12>:L
r$rGc#<00><>K<00>d<01><01>|jd<02>}|dk\r"|dz<00><01>|jd|dz<00>}|dk\r<01>"t|<00>dz<00><01>y<00>w)NrrVr)<02>findr<64>)<02>template_source<63>ps r%r<>r<>s\<00><00><><00>
<0B>G<EFBFBD><17><1C><1C>T<EFBFBD>"<22>A<EFBFBD>
<0B>q<EFBFBD>&<26><0F>!<21>e<EFBFBD> <0B> <1B> <20> <20><14>q<EFBFBD>1<EFBFBD>u<EFBFBD> -<2D><01> <0C>q<EFBFBD>&<26> <0E>o<EFBFBD>
<1E><11>
"<22>"<22>s
<00><A<01>Ac<00> <00>eZdZdd<02>Zd<03>Zd<04>Zy)<06>TokenNc<00><<00>||_||_||_||_y)a7
A token representing a string from the template.
token_type
A TokenType, either .TEXT, .VAR, .BLOCK, or .COMMENT.
contents
The token source string.
position
An optional tuple containing the start and end index of the token
in the template source. This is used for traceback information
when debug is on.
lineno
The line number the token appears on in the template source.
This is used for traceback information and gettext files.
N)<04>
token_type<EFBFBD>contents<74>linenor<6F>)r-r<>r<>r<>r<>s r%r.zToken.__init__%s <00><00>&%<25><04><0F> <20><04> <0A><1C><04> <0B> <20><04> r$c<00><><00>|jjj<00>}d|<01>d|jddj dd<05><00>d<06>S)Nr:z token: "rUrVrWrX)r<>r5<00>
capitalizer<EFBFBD>rY)r-<00>
token_names r%r=zToken.__repr__=sB<00><00><19>_<EFBFBD>_<EFBFBD>)<29>)<29>4<>4<>6<>
<EFBFBD> <16> <10>M<EFBFBD>M<EFBFBD>#<23>2<EFBFBD> <1E> &<26> &<26>t<EFBFBD>R<EFBFBD> 0<>
<EFBFBD>
r$c<00><<00>g}t|j<00>}|D]}|jd<01>r[|ddz}|g}|j|<04>s.t |<02>}|j |<03>|j|<04>s<01>.dj |<05>}|j |<03><00><>|S)N)z_("z_('r<00>)<29> )r r<><00>
startswith<EFBFBD>endswithr<68>r<><00>join)r-<00>split<69>bits<74>bit<69>sentinel<65> trans_bits r%<00>split_contentszToken.split_contentsDs<><00><00><12><05><1A>4<EFBFBD>=<3D>=<3D>)<29><04><17>C<EFBFBD><12>~<7E>~<7E>n<EFBFBD>-<2D><1E>q<EFBFBD>6<EFBFBD>C<EFBFBD><<3C><08> <20>E<EFBFBD> <09><1D>,<2C>,<2C>x<EFBFBD>0<><1E>t<EFBFBD>*<2A>C<EFBFBD><1D>$<24>$<24>S<EFBFBD>)<29><1E>,<2C>,<2C>x<EFBFBD>0<><1A>h<EFBFBD>h<EFBFBD>y<EFBFBD>)<29><03> <11>L<EFBFBD>L<EFBFBD><13> <1D><18><15> r$rD)rrrr.r=r<>r#r$r%r<>r<>$s<00><00>!<21>0
<EFBFBD> r$r<>c<00>$<00>eZdZd<01>Zd<02>Zd<03>Zd<04>Zy)rgc<00> <00>||_d|_y)NF)rR<00>verbatim)r-rRs r%r.zLexer.__init__Us<00><00>.<2E><04><1C><1D><04> r$c<00><><00>d|jj<00>d|jddjdd<05><00>d|j<00>d<07>S)Nr:rTrUrVrWz...", verbatim=r;)r<rrRrYr<>r0s r%r=zLexer.__repr__Ys=<00><00> <10>N<EFBFBD>N<EFBFBD> '<27> '<27> <10> <20> <20><13>"<22> %<25> -<2D> -<2D>d<EFBFBD>B<EFBFBD> 7<> <10>M<EFBFBD>M<EFBFBD>
<EFBFBD>
r$c <00><><00>d}d}g}tj|j<00>D]>}|r7|j|j |d||<01><00>||j d<04>z }| }<01>@|S)zG
Return a list of tokens from a given template_string.
FrNrV)<06>tag_rer<65>rRr<><00> create_token<65>count)r-<00>in_tagr<67><00>result<6C> token_strings r%rhzLexer.tokenize`so<00><00><17><06><12><06><13><06>"<22>L<EFBFBD>L<EFBFBD><14>)=<3D>)=<3D>><3E>L<EFBFBD><1B><16> <0A> <0A>d<EFBFBD>/<2F>/<2F> <0C>d<EFBFBD>F<EFBFBD>F<EFBFBD>S<>T<><16>,<2C>,<2C>,<2C>T<EFBFBD>2<>2<><06><1F>Z<EFBFBD>F<EFBFBD> ?<3F>
<16> r$c<00>.<00>|r<>|dd}|tk(r|ddj<00>}|jr3||jk7rttj
|||<03>Sd|_n|dddvr
d|z|_ttj |||<03>S|js_|ddj<00>}|tk(rttj|||<03>S|tk(sJ<00>ttj|||<03>Sttj
|||<03>S) z<>
Convert the given token string into a new Token object and return it.
If in_tag is True, we are processing something that matched a tag,
otherwise it should be treated as a literal string.
rr<00><><EFBFBD><EFBFBD><EFBFBD>FN<46> )r<>z verbatim zend%s) <0B>BLOCK_TAG_START<52>stripr<70>r<>rrr!<00>VARIABLE_TAG_STARTr <00>COMMENT_TAG_STARTr")r-r<>r<>r<>r<><00> token_start<72>contents r%r<>zLexer.create_tokenns<00><00> <12> '<27>q<EFBFBD><11>+<2B>K<EFBFBD><1A>o<EFBFBD>-<2D>&<26>q<EFBFBD><12>,<2C>2<>2<>4<><07><17>=<3D>=<3D><1E>$<24>-<2D>-<2D>/<2F>$<24>Y<EFBFBD>^<5E>^<5E>\<5C>8<EFBFBD>V<EFBFBD>T<>T<>$)<29>D<EFBFBD>M<EFBFBD><1C>R<EFBFBD>a<EFBFBD>[<5B>$=<3D>=<3D>$+<2B>g<EFBFBD>$5<>D<EFBFBD>M<EFBFBD><1C>Y<EFBFBD>_<EFBFBD>_<EFBFBD>g<EFBFBD>x<EFBFBD><16>H<>H<><17>=<3D>=<3D>&<26>q<EFBFBD><12>,<2C>2<>2<>4<><07><1E>"4<>4<> <20><19><1D><1D><07><18>6<EFBFBD>J<>J<>"<22>&7<>7<>7<>7<><1C>Y<EFBFBD>.<2E>.<2E><07><18>6<EFBFBD>J<>J<><14>Y<EFBFBD>^<5E>^<5E>\<5C>8<EFBFBD>V<EFBFBD>D<>Dr$N)rrrr.r=rhr<>r#r$r%rgrgTs<00><00><1E>
<EFBFBD> <16> Er$rgc<00><00>eZdZd<01>Zd<02>Zd<03>Zy)rfc#<00><>K<00>d}tj|j<00>D]#}|j<00>\}}||f<02><01>||f<02><01>|}<01>%|t |j<00>f<02><01>y<00>w)Nr)r<><00>finditerrR<00>spanr<6E>)r-<00>last<73>matchr<68>r<>s r%<00>_tag_re_split_positionsz"DebugLexer._tag_re_split_positions<6E>sd<00><00><><00><10><04><1B>_<EFBFBD>_<EFBFBD>T<EFBFBD>%9<>%9<>:<3A>E<EFBFBD><1E><1A><1A><1C>J<EFBFBD>E<EFBFBD>3<EFBFBD><16><05>+<2B> <1D><17><13>*<2A> <1C><16>D<EFBFBD> ;<3B>
<13>C<EFBFBD><04>,<2C>,<2C>-<2D>-<2D>-<2D>s<00>A"A$c#<00>hK<00>|j<00>D]}|jt|<01>|f<02><01><00>y<00>wr))r<>rR<00>slice)r-r<>s r%<00> _tag_re_splitzDebugLexer._tag_re_split<69>s4<00><00><><00><1C>4<>4<>6<>H<EFBFBD><16>&<26>&<26>u<EFBFBD>h<EFBFBD>'7<>8<>(<28>B<> B<>7<>s<00>02c <00><><00>d}d}g}|j<00>D]A\}}|r7|j|j||||<01><00>||jd<03>z }| }<01>C|S)z<>
Split a template string into tokens and annotates each token with its
start and end position in the source. This is slower than the default
lexer so only use it when debug is True.
FrrV)r<>r<>r<>r<>)r-r<>r<>r<>r<>r<>s r%rhzDebugLexer.tokenize<7A>so<00><00><17><06><12><06><13><06>&*<2A>&8<>&8<>&:<3A> "<22>L<EFBFBD>(<28><1B><16> <0A> <0A>d<EFBFBD>/<2F>/<2F> <0C>h<EFBFBD><06>PV<50>W<>X<><16>,<2C>,<2C>,<2C>T<EFBFBD>2<>2<><06><1F>Z<EFBFBD>F<EFBFBD> ';<3B>
<16> r$N)rrrr<>r<>rhr#r$r%rfrf<00>s<00><00>.<2E>C<01>r$rfc<00>f<00>eZdZdd<02>Zd<03>Zdd<04>Zd<05>Zd<06>Zd<07>Zdd<08>Z d <09>Z
d
<EFBFBD>Z d <0B>Z d <0C>Z d <0A>Zd<0E>Zd<0F>Zy)riNc<00><><00>tt|<01><00>|_i|_i|_g|_i|_|<02>i}|<03>g}||_|D]}|j|<05><00>||_ yr))
<EFBFBD>list<73>reversedrs<00>tags<67>filters<72> command_stackrm<00> libraries<65> add_libraryrM)r-rsr<><00>builtinsrM<00>builtins r%r.zParser.__init__<5F>sp<00><00><1B>8<EFBFBD>F<EFBFBD>+<2B>,<2C><04> <0B><16><04> <09><19><04> <0C><1F><04><1A> <1D><04><0F> <14> <1C><1A>I<EFBFBD> <13> <1B><19>H<EFBFBD>"<22><04><0E><1F>G<EFBFBD> <10> <1C> <1C>W<EFBFBD> %<25> <20><1C><04> r$c<00>P<00>d|jj<00>d|j<00>d<03>S)Nr:z tokens=r;)r<rrsr0s r%r=zParser.__repr__<5F>s<00><00>#'<27>><3E>><3E>#><3E>#><3E><04> <0B> <0B>L<>Lr$c<00>^<00>|<01>g}t<00>}|j<00>rj|j<00>}|jj}|dk(r(|j |t |j<00>|<03><00>n |dk(rf|js|j|d|jz<00><00> |j|j<00>}t|<05>}|j |||<03>n<>|dk(r<> |jj<00>d}||vr|j|<03>|S|j j#||f<02> |j$|}  ||<03>}
|j ||
|<03>|j j-<00>|jr<02><01>j|r|j/|<01>|S#t$r}|j||<06><00>d}~wwxYw#t$r |j|d|jz<00><00>wxYw#t&$r|j)|||<01>Y<00><>wxYw#t*$r}|j||<06><00>d}~wwxYw)ax
Iterate through the parser tokens and compiles each one into a node.
If parse_until is provided, parsing will stop once one of the
specified tokens has been reached. This is formatted as a list of
tokens, e.g. ['elif', 'else', 'endif']. If no matching token is
reached, raise an exception with the unclosed block tag details.
NrrzEmpty variable tag on line %drzEmpty block tag on line %d)<18>NodeListrs<00>
next_tokenr<EFBFBD><00>value<75>extend_nodelist<73>TextNoder<65><00>errorr<72><00>compile_filterr<00> VariableNoder<65>r<><00> prepend_tokenr<6E>r<>r<><00>KeyError<6F>invalid_block_tagrn<00>pop<6F>unclosed_block_tag) r-<00> parse_untilrQrpr<><00>filter_expressionru<00>var_node<64>command<6E> compile_func<6E>compiled_results r%rlz Parser.parse<73>s&<00><00> <17> <1E><1C>K<EFBFBD><1B>:<3A><08><12>k<EFBFBD>k<EFBFBD><18>O<EFBFBD>O<EFBFBD>%<25>E<EFBFBD><1E>)<29>)<29>/<2F>/<2F>J<EFBFBD><19>Q<EFBFBD><EFBFBD><14>$<24>$<24>X<EFBFBD>x<EFBFBD><05><0E><0E>/G<><15>O<><1B>q<EFBFBD><1F><1C>~<7E>~<7E><1E>*<2A>*<2A><1D>><3E><15><1C><1C>M<><16><16>/<2F>(,<2C>(;<3B>(;<3B>E<EFBFBD>N<EFBFBD>N<EFBFBD>(K<>%<25>(<28>(9<>:<3A><08><14>$<24>$<24>X<EFBFBD>x<EFBFBD><15>?<3F><1B>q<EFBFBD><1F>Y<01>#<23>n<EFBFBD>n<EFBFBD>2<>2<>4<>Q<EFBFBD>7<>G<EFBFBD><1B>k<EFBFBD>)<29><19>&<26>&<26>u<EFBFBD>-<2D>#<23>O<EFBFBD><15>"<22>"<22>)<29>)<29>7<EFBFBD>E<EFBFBD>*:<3A>;<3B>H<01>#'<27>9<EFBFBD>9<EFBFBD>W<EFBFBD>#5<>L<EFBFBD>
/<2F>&2<>4<EFBFBD><15>&?<3F>O<EFBFBD><15>$<24>$<24>X<EFBFBD><EFBFBD><05>F<><14>"<22>"<22>&<26>&<26>(<28>]<13>k<EFBFBD>k<EFBFBD>^ <17> <10> #<23> #<23>K<EFBFBD> 0<><17><0F><>I+<2B>/<2F><1E>*<2A>*<2A>U<EFBFBD>A<EFBFBD>.<2E>.<2E><>/<2F><>"<22>Y<01><1E>*<2A>*<2A>U<EFBFBD>,H<>5<EFBFBD><<3C><<3C>,W<>X<>X<>Y<01><>  <20>H<01><18>*<2A>*<2A>5<EFBFBD>'<27>;<3B>G<>H<01><> !<21>/<2F><1E>*<2A>*<2A>U<EFBFBD>A<EFBFBD>.<2E>.<2E><>/<2F>sN<00> F<00> F><00>2G*<00> H <00> F;<03>$F6<03>6F;<03>>)G'<03>*H <03>H <03> H,<03>H'<03>'H,c<00><><00>|jrJ|j<00>}|jtjk(r|j
|k(ry|jr<01>J|j |g<01>yr))rsr<>r<>rr!r<>r<>)r-<00>endtagrps r%<00> skip_pastzParser.skip_pastsP<00><00><12>k<EFBFBD>k<EFBFBD><18>O<EFBFBD>O<EFBFBD>%<25>E<EFBFBD><14><1F><1F>9<EFBFBD>?<3F>?<3F>2<>u<EFBFBD>~<7E>~<7E><16>7O<37><16><13>k<EFBFBD>k<EFBFBD> <0A><1F><1F><16><08>)r$c<00>j<00>|jrg|jr[|jjr t |jj<00>}nd}|j |d|j <00>d|<04>d<04><05><00>t|t<00>sd|_||_ |j|_|j|<02>y)Nz the templatez{% z %} must be the first tag in rT) <0B> must_be_first<73>contains_nontextrMr6<00>reprr<72>r<>r?r<>rpr<>)r-rQ<00>noderprMs r%r<>zParser.extend_nodelists<><00><00> <0F> <1D> <1D>(<28>";<3B>";<3B><13>{<7B>{<7B>(<28>(<28><1D>d<EFBFBD>k<EFBFBD>k<EFBFBD>7<>7<>8<><06>'<27><06><16>*<2A>*<2A><15>=B<>^<5E>^<5E>V<EFBFBD>T<><0E> <0E><1A>$<24><08>)<29>(,<2C>H<EFBFBD> %<25><1B><04>
<EFBFBD><1A>k<EFBFBD>k<EFBFBD><04> <0B><10><0F><0F><04>r$c<00>b<00>t|t<00>s t|<02>}t|d<01>s||_|S)a1
Return an exception annotated with the originating token. Since the
parser can be called recursively, check if a token is already set. This
ensures the innermost token is highlighted if an exception occurs,
e.g. a compile error within the body of an if statement.
rp)r?rnr<00>hasattrrp)r-rprus r%r<>z Parser.error(s.<00><00><1A>!<21>Y<EFBFBD>'<27>#<23>A<EFBFBD>&<26>A<EFBFBD><16>q<EFBFBD>'<27>"<22><1B>A<EFBFBD>G<EFBFBD><10>r$c <00><><00>|r=|j|d|j|t|D<00>cgc]}d|z<00><02> c}d<03>fz<00><00>|j|d|j|fz<00><00>cc}w)Nz]Invalid block tag on line %d: '%s', expected %s. Did you forget to register or load this tag?z'%s'<27>orzPInvalid block tag on line %d: '%s'. Did you forget to register or load this tag?)r<>r<>r )r-rpr<>r<>r<>s r%r<>zParser.invalid_block_tag5s<><00><00> <16><16>*<2A>*<2A><15>7<><1A>L<EFBFBD>L<EFBFBD><1B>!<21>{<7B>"C<>{<7B>!<21>6<EFBFBD>A<EFBFBD>:<3A>{<7B>"C<>T<EFBFBD>J<><12><12> <0E> <0E><13>j<EFBFBD>j<EFBFBD> <11> <20>#(<28><<3C><<3C><17>"9<> :<3A>
<EFBFBD>
<EFBFBD><EFBFBD>#Ds<00> A!c<00><><00>|jj<00>\}}d|j|dj|<01>fz}|j ||<04><00>)Nz6Unclosed tag on line %d: '%s'. Looking for one of: %s.z, )r<>r<>r<>r<>r<>)r-r<>r<>rpr+s r%r<>zParser.unclosed_block_tagGsS<00><00><1D>+<2B>+<2B>/<2F>/<2F>1<><0E><07><15>F<> <11>L<EFBFBD>L<EFBFBD> <13> <10>I<EFBFBD>I<EFBFBD>k<EFBFBD> "<22>J
<EFBFBD>
<EFBFBD><03>
<13>j<EFBFBD>j<EFBFBD><15><03>$<24>$r$c<00>6<00>|jj<00>Sr))rsr<>r0s r%r<>zParser.next_tokenPs<00><00><13>{<7B>{<7B><EFBFBD><EFBFBD> <20> r$c<00>:<00>|jj|<01>yr))rsr<><00>r-rps r%r<>zParser.prepend_tokenSs<00><00> <0C> <0B> <0B><1A><1A>5<EFBFBD>!r$c<00><00>|jd=y)N<><4E><EFBFBD><EFBFBD><EFBFBD>)rsr0s r%<00>delete_first_tokenzParser.delete_first_tokenVs <00><00> <10>K<EFBFBD>K<EFBFBD><02>Or$c<00><><00>|jj|j<00>|jj|j<00>yr))r<><00>updater<65>)r-<00>libs r%r<>zParser.add_libraryYs.<00><00> <0C> <09> <09><18><18><13><18><18>"<22> <0C> <0C> <0C><1B><1B>C<EFBFBD>K<EFBFBD>K<EFBFBD>(r$c<00><00>t||<00>S)z9
Convenient wrapper for FilterExpression
)<01>FilterExpressionr<6E>s r%r<>zParser.compile_filter]s<00><00> <20><05>t<EFBFBD>,<2C>,r$c<00>X<00>||jvr|j|Std|z<00><00>)NzInvalid filter: '%s')r<>r)r-<00> filter_names r%<00> find_filterzParser.find_filtercs.<00><00> <16>$<24>,<2C>,<2C> &<26><17><<3C><<3C> <0B>,<2C> ,<2C>%<25>&<<3C>{<7B>&J<>K<> Kr$r<>r))rrrr.r=rlr<>r<>r<>r<>r<>r<>r<>r<>r<>r<>rr#r$r%riri<00>sK<00><00><1D>0M<01>=<18>~*<2A><1E>& <11>
<EFBFBD>$%<25>!<21>"<22><1C>)<29>-<2D> Lr$rizf
(?:%(i18n_open)s%(strdq)s%(i18n_close)s|
%(i18n_open)s%(strsq)s%(i18n_close)s|
%(strdq)s|
%(strsq)s)
z"[^"\\]*(?:\\.[^"\\]*)*"z'[^'\\]*(?:\\.[^'\\]*)*'<27>_(r<>)<04>strdq<64>strsq<73> i18n_open<65>
i18n_closerVrWa
^(?P<constant>%(constant)s)|
^(?P<var>[%(var_chars)s]+|%(num)s)|
(?:\s*%(filter_sep)s\s*
(?P<filter_name>\w+)
(?:%(arg_sep)s
(?:
(?P<constant_arg>%(constant)s)|
(?P<var_arg>[%(var_chars)s]+|%(num)s)
)
)?
)z[-+.]?\d[\d.e]*z\w\.)<05>constantr<74><00> var_chars<72>
filter_sep<EFBFBD>arg_sepc<00>D<00>eZdZdZdZd<03>Zd d<04>Zd<05>Zee<07>Zd<06>Z d<07>Z
y)
ra<>
Parse a variable token and its optional filters (all as a single string),
and return a list of tuples of the filter name and arguments.
Sample::
>>> token = 'variable|default:"Default value"|date:"Y-m-d"'
>>> p = Parser('')
>>> fe = FilterExpression(token, p)
>>> len(fe.filters)
2
>>> fe.var
<Variable: 'variable'>
)rpr<><00>var<61>is_varc <00>@<00>||_tj|<01>}d}g}d}|D<00>]}|j<00>}||k7rt d|d|<00>d|||<00>d||d<00><01><06><00>|<04>D|dx} r t | <09>j i<00>}n<>|dx}
<EFBFBD>t d|z<00><00>t |
<EFBFBD>}n<>|d} g} |dx} r,| jd t | <0A>j i<00>f<02>n#|d
x}r| jd t |<0E>f<02>|j| <0B>}|j| || <0C>|j|| f<02>|j<00>}<06><01>"|t|<01>k7rt d ||d<00>d |<01>d<0E><05><00>||_ ||_t|t
<00>|_y#t$rd}Y<00>gwxYw)Nrz!Could not parse some characters: rr rz'Could not find variable at start of %s.r<00> constant_argF<67>var_argTz Could not parse the remainder: 'z' from '<27>')rp<00> filter_rer<65>r<>r<00>Variable<6C>resolver'r<>r<00>
args_checkr<EFBFBD>r<>r<>rr?r)r-rprt<00>matches<65>var_objr<6A>r<>r<>r<>r rrr<>rr<00> filter_funcs r%r.zFilterExpression.__init__<5F>s<><00><00><1A><04>
<EFBFBD><1B>$<24>$<24>U<EFBFBD>+<2B><07><16><07><14><07><10><04><1C>E<EFBFBD><19>K<EFBFBD>K<EFBFBD>M<EFBFBD>E<EFBFBD><13>u<EFBFBD>}<7D>)<29>"'<27><05><14>,<2C><05>d<EFBFBD>5<EFBFBD>0A<30>5<EFBFBD><15><16>=<3D>R<01><12><12><17><EFBFBD>$<24>Z<EFBFBD>0<>0<>8<EFBFBD>0<>'<27>"*<2A>8<EFBFBD>"4<>"<<3C>"<<3C>R<EFBFBD>"@<40><07>#<23>5<EFBFBD>\<5C>)<29>c<EFBFBD>2<>-<2D>A<>E<EFBFBD>I<><16><16>'<27>s<EFBFBD>m<EFBFBD>G<EFBFBD>#<23>M<EFBFBD>2<> <0B><19><04>#(<28><1E>#8<>8<><<3C>8<><18>K<EFBFBD>K<EFBFBD><15><08><1C>(><3E>(F<>(F<>r<EFBFBD>(J<> K<>L<> %<25>i<EFBFBD> 0<>0<>W<EFBFBD>0<><18>K<EFBFBD>K<EFBFBD><14>x<EFBFBD><07>'8<> 9<>:<3A>$<24>0<>0<><1B>=<3D> <0B><14><0F><0F> <0B>[<5B>$<24>?<3F><17><0E><0E> <0B>T<EFBFBD>2<>3<><18>9<EFBFBD>9<EFBFBD>;<3B>D<EFBFBD>;<1D>< <10>3<EFBFBD>u<EFBFBD>:<3A> <1D>%<25>$<24>T<EFBFBD>U<EFBFBD>|<7C>U<EFBFBD>4<><0E> <0E>
<1F><04> <0C><1A><04><08> <20><17>(<28>3<><04> <0B><>70<>'<27>"&<26><07>'<27>s<00>%F<02> F<05>Fc<00><><00>|jr |jj|<01>}n |j}|jD]<5D>\}}g}|D]B\}} |s|jt| <09><00><00>#|j| j|<01><00><00>Dt|dd<03>rt||j<00>}t|dd<03>r||g|<07><01>d|ji<01>}
n ||g|<07><01><06>}
t|dd<03>rt|t<00>r t|
<EFBFBD>}<03><>|
}<03><>|S#t$rF|rd}n=|jj
j }|rd|vr||jzcYS|cYS|}Y<00><01>(wxYw)Nz%s<>expects_localtimeF<65>needs_autoescape<70>
autoescape<EFBFBD>is_safe)rrrr'rbrJ<00>string_if_invalidr<64>r<>r
<00>getattrr<00>use_tzr r?r) r-r]<00>ignore_failures<65>objr"<00>funcr<63><00>arg_vals<6C>lookup<75>arg<72>new_objs r%rzFilterExpression.resolve<76>sR<00><00> <0F>;<3B>;<3B> 0<><1A>h<EFBFBD>h<EFBFBD>&<26>&<26>w<EFBFBD>/<2F><03><17>(<28>(<28>C<EFBFBD><1E>,<2C>,<2C>J<EFBFBD>D<EFBFBD>$<24><19>H<EFBFBD>#<23> <0B><06><03><1D><1C>O<EFBFBD>O<EFBFBD>I<EFBFBD>c<EFBFBD>N<EFBFBD>3<><1C>O<EFBFBD>O<EFBFBD>C<EFBFBD>K<EFBFBD>K<EFBFBD><07>$8<>9<> $<24>
<17>t<EFBFBD>0<>%<25>8<>(<28><13>g<EFBFBD>n<EFBFBD>n<EFBFBD>=<3D><03><16>t<EFBFBD>/<2F><15>7<><1E>s<EFBFBD>M<>H<EFBFBD>M<>w<EFBFBD>/A<>/A<>M<><07><1E>s<EFBFBD>.<2E>X<EFBFBD>.<2E><07><16>t<EFBFBD>Y<EFBFBD><05>.<2E>:<3A>c<EFBFBD>8<EFBFBD>3L<33><1F><07>(<28><03><1D><03>!'<27>"<13>
<EFBFBD><EFBFBD>?(<28> 0<>"<22><1E>C<EFBFBD>(/<2F>(8<>(8<>(?<3F>(?<3F>(Q<>(Q<>%<25>(<28><1F>#4<>4<>#4<>t<EFBFBD>x<EFBFBD>x<EFBFBD>#?<3F>?<3F>#4<>4<>/<2F><03><> 0<>s<00>D<00>AE<03>E<03>E<03>Ec<00><00>t|<02>}t|<02>dz}tj|<01>}tj|<01>\}}}}}}}t|<04>}t|xsg<00>}|||z
ks||kDrt d|||z
|fz<00><00>y)Nrz%%s requires %d arguments, %d providedT)r<>r<><00>inspect<63>unwrap<61>getfullargspecr) r5r'<00>provided<65>plenr<6E><00>_<>defaults<74>alen<65>dlens r%rzFilterExpression.args_check<63>s<><00><00><17><08>><3E><08><12>8<EFBFBD>}<7D>q<EFBFBD> <20><04><16>~<7E>~<7E>d<EFBFBD>#<23><04>(/<2F>(><3E>(><3E>t<EFBFBD>(D<>%<25><04>a<EFBFBD><11>H<EFBFBD>a<EFBFBD><11>A<EFBFBD><12>4<EFBFBD>y<EFBFBD><04><12>8<EFBFBD>><3E>r<EFBFBD>"<22><04> <0F>4<EFBFBD>$<24>;<3B> <1F>4<EFBFBD>$<24>;<3B>%<25>7<>4<EFBFBD><14><04><1B>d<EFBFBD>:S<>S<><0E> <0E>r$c<00><00>|jSr))rpr0s r%r1zFilterExpression.__str__s <00><00><13>z<EFBFBD>z<EFBFBD>r$c<00>P<00>d|jj<00>d|j<00>d<03>S)Nr:r<>r;)r<rrpr0s r%r=zFilterExpression.__repr__ s<00><00> <20>N<EFBFBD>N<EFBFBD>7<>7<><14><1A><1A>D<>Dr$N<>F) rrr<00>__doc__<5F> __slots__r.rr<00> staticmethodr1r=r#r$r%rr<00>s6<00><00> <08>6<>I<EFBFBD>,4<>\#<13>J<14>$<1E>j<EFBFBD>)<29>J<EFBFBD><1A>Er$rc<00>2<00>eZdZdZdZd<03>Zd<04>Zd<05>Zd<06>Zd<07>Z y) ra'
A template variable, resolvable against a given context. The variable may
be a hard-coded string (if it begins and ends with single or double quote
marks)::
>>> c = {'article': {'section':'News'}}
>>> Variable('article.section').resolve(c)
'News'
>>> Variable('article').resolve(c)
{'section': 'News'}
>>> class AClass: pass
>>> c = AClass()
>>> c.article = AClass()
>>> c.article.section = 'News'
(The example assumes VARIABLE_ATTRIBUTE_SEPARATOR is '.')
)r<00>literal<61>lookups<70> translate<74>message_contextc<00>V<00>||_d|_d|_d|_d|_t |t <00>stdt|<01>z<00><00> d|vsd|j<00>vrt|<01>|_|ddk(rt<00>t|<01>|_yy#t$r<>|dddk(r|dd k(r d
|_|dd} tt|<01><00>|_Yy#t$rHtd z|vs|dd k(rt!d |z<00><00>t#|j%t<00><00>|_YYywxYwwxYw) NFz+Variable must be a string or number, got %srrur<>rrrr<>Tr2z=Variables and attributes may not begin with underscores: '%s')rr=r>r?r@r?rN<00> TypeError<6F>type<70>lower<65>float<61>
ValueError<EFBFBD>intr
r <00>VARIABLE_ATTRIBUTE_SEPARATORr<00>tupler<65>)r-rs r%r.zVariable.__init__$sB<00><00><16><04><08><1B><04> <0C><1B><04> <0C><1E><04><0E>#<23><04><1C><19>#<23>s<EFBFBD>#<23><1B>I<>D<EFBFBD>QT<51>I<EFBFBD>U<>V<> V<># N<01><13>c<EFBFBD>z<EFBFBD>S<EFBFBD>C<EFBFBD>I<EFBFBD>I<EFBFBD>K<EFBFBD>/<2F>$<24>S<EFBFBD>z<EFBFBD><04> <0C><16>r<EFBFBD>7<EFBFBD>c<EFBFBD>><3E>$<24>$<24>"<22>3<EFBFBD>x<EFBFBD><04> <0C>"<22><><1A> N<01><12>1<EFBFBD>Q<EFBFBD>x<EFBFBD>4<EFBFBD><1F>C<EFBFBD><02>G<EFBFBD>s<EFBFBD>N<EFBFBD>"&<26><04><0E><19>!<21>B<EFBFBD>i<EFBFBD><03>
N<01>(<28>)@<40><13>)E<>F<><04> <0C><><1D> N<01>0<>#<23>5<><13><<3C><03>A<EFBFBD><06>#<23> <0A>-<2D>;<3B>=@<40>A<01><16><16> %<25>S<EFBFBD>Y<EFBFBD>Y<EFBFBD>/K<>%L<>M<><04> <0C> N<01><> N<01>s,<00> AB<00>%D(<03>8C<02>A D$<05> D(<03>#D$<05>$D(c<00>.<00>|j<00>|j|<01>}n |j}|jr^t |t
<00>}|j dd<02>}|r t|<04>n|}|jrt|j|<04>St|<04>S|S)z.Resolve this variable against a given context.<2E>%z%%) r><00>_resolve_lookupr=r?r?rrYr
r@rr)r-r]r<>r!<00>msgids r%rzVariable.resolveRs<><00><00> <0F><<3C><<3C> #<23><18>(<28>(<28><17>1<>E<EFBFBD><19>L<EFBFBD>L<EFBFBD>E<EFBFBD> <0F>><3E>><3E> <20><15><08>1<>G<EFBFBD><19>M<EFBFBD>M<EFBFBD>#<23>t<EFBFBD>,<2C>E<EFBFBD>(/<2F>I<EFBFBD>e<EFBFBD>$<24>U<EFBFBD>E<EFBFBD><13>#<23>#<23>$<24>T<EFBFBD>%9<>%9<>5<EFBFBD>A<>A<>#<23>E<EFBFBD>*<2A>*<2A><14> r$c<00>P<00>d|jj<00>d|j<00>d<03>S)Nr:<00>: r;)r<rrr0s r%r=zVariable.__repr__ds<00><00>!<21>^<5E>^<5E>4<>4<>d<EFBFBD>h<EFBFBD>h<EFBFBD>?<3F>?r$c<00><00>|jSr))rr0s r%r1zVariable.__str__gs <00><00><13>x<EFBFBD>x<EFBFBD>r$c <00><><00>|} |jD]s} tt|<02>d<01>st<00>||}t|<02>s<01>0t|dd<04>r<01>>t|dd<04>r!|jj j"}<02>l |<02>}<02>u |S#ttt
t tf$r<> t|t<00>rtt|<02>|<03>rt<00>t||<03>}nn#ttf$r\t|t<00>s|t|<02>vr<01> |t|<03>}n+#tt t
tf$rtd||f<02><00>wxYwYnwxYwY<00><01>wxYw#t$r<> t%j&|<02>} |j)<00><00>#t$r#|jj j"}Yn3wxYw#t $r#|jj j"}YnwxYwY<00><01><>wxYw#t*$rd}t|dd<07>xsd}t,j/d |d
<EFBFBD> <0B>t|d d<04>r!|jj j"}n<01>Yd}~|Sd}~wwxYw) a
Perform resolution of a real variable (i.e. not a literal) against the
given context.
As indicated by the method's name, this method is an implementation
detail and shouldn't be called by external code. Use Variable.resolve()
instead.
<20> __getitem__z Failed lookup for key [%s] in %r<>do_not_call_in_templatesF<73> alters_datar6N<>unknownz9Exception while resolving variable '%s' in template '%s'.T)<01>exc_info<66>silent_variable_failure)r>r<>rCrB<00>AttributeErrorr<72>rFr<>r?rr#<00>dirrGr'<00>callablerbrJr"r-<00> signature<72>bindrn<00>loggerre)r-r]<00>currentr<74>r[rur6s r%rLzVariable._resolve_lookupjs`<00><00><1A><07>C <16><1B>|<7C>|<7C><03><1E>#<23>4<EFBFBD><07>=<3D>-<2D>@<40>'<27><0F>%<25>c<EFBFBD>l<EFBFBD>G<EFBFBD>6<1C>G<EFBFBD>$<24><1E>w<EFBFBD>(B<>E<EFBFBD>J<><1C> <20><17>-<2D><15>?<3F>")<29>"2<>"2<>"9<>"9<>"K<>"K<><07>*<2A>&-<2D>i<EFBFBD>G<EFBFBD>Q$<24>H<17><0E><>w"<22>><3E>8<EFBFBD>Z<EFBFBD><1A>T<><1E><1E>%<25>g<EFBFBD>{<7B>;<3B><07> <20><17>M<EFBFBD>3<EFBFBD>A<1A>#1<>0<>")<29>'<27>3<EFBFBD>"7<><07><>%<25>~<7E>6<><1E>)<29>'<27>;<3B>?<3F>C<EFBFBD>3<EFBFBD>w<EFBFBD><<3C>DW<44>!<21> <1E>&-<2D>c<EFBFBD>#<23>h<EFBFBD>&7<>G<EFBFBD><47>&<26>&<26>$<24>%<25>  <1A> <1E> #7<> B<>!$<24>g<EFBFBD><0E>#<1E><1E> <1E><>$<24> <1E><><1E><>@ )<29> *<2A> *<2A>,3<>,=<3D>,=<3D>g<EFBFBD>,F<> <09>!*<2A>$-<2D>N<EFBFBD>N<EFBFBD>$4<>
%*<2A><> (1<>!X<01>.5<EFBFBD>.><3E>.><3E>.E<>.E<>.W<>.W<>G<EFBFBD>!X<01><> $.<2E>T<01>*1<>*:<3A>*:<3A>*A<>*A<>*S<>*S<><07>T<01><> *<2A><><19> <16>#<23>G<EFBFBD>_<EFBFBD>d<EFBFBD>C<>P<>y<EFBFBD>M<EFBFBD> <12>L<EFBFBD>L<EFBFBD>K<><13><1D><1D> <19> <0E><17>q<EFBFBD>3<>U<EFBFBD>;<3B>!<21>*<2A>*<2A>1<>1<>C<>C<><07><15><18><17><0E><> <16>s<EFBFBD><00>G+<00> B <02> G+<00><G+<00>=E<02>G+<00> E<05>(7C <04>E<05> -E <07>D<06>E <07>(E <09>E <07>E<05>
E <07> E<05>G+<00>E<05>G+<00> G(<05>F5<04>5F<04>G(<05>)F2<07>/G(<05>1F2<07>2G(<05>5)G!<07>G(<05> G!<07>!G(<05>$G+<00>'G(<05>(G+<00>+ I<03>4AI<03>IN)
rrrr9r:r.rr=r1rLr#r$r%rrs,<00><00><08>$N<01>I<EFBFBD>,N<01>\<15>$@<01><18>Or$rc<00>*<00>eZdZdZdZdZd<04>Zd<05>Zd<06>Zy)<07>NodeF)rQNc<00><00>y)z7
Return the node rendered as a string.
Nr#r\s r%r[z Node.render<65>s<00><00> r$c<00><><00> |j|<01>S#t$r<>}|jjjr<>t |d<01>s||_t |d<02>sv|jjj|j jk(r?|jjj||j j<00>|_ <00>d}~wwxYw)a'
Render the node. If debug is True and an exception occurs during
rendering, the exception is annotated with contextual line information
where it occurred in the template. For internal usage this method is
preferred over using the render method directly.
<20> _culprit_noderqN) r[rnrbrJrer<>rcr`rMrorprq)r-r]rus r%<00>render_annotatedzNode.render_annotated<65>s<><00><00> <12><17>;<3B>;<3B>w<EFBFBD>'<27> '<27><><18> <12><16><1F><1F>&<26>&<26>,<2C>,<2C><1E>q<EFBFBD>/<2F>2<>&*<2A>A<EFBFBD>O<EFBFBD><1F><01>#3<>4<><1F>.<2E>.<2E>7<>7<>><3E>><3E>!<21>/<2F>/<2F>BX<42>BX<42>X<> <20>.<2E>.<2E>7<>7<>J<>J<><1D><1D>O<EFBFBD>O<EFBFBD>1<>1<><1A><16>$<24> <12><> <12>s<00><00> C<03>B6C<03>Cc<00><><00>g}t||<01>r|j|<00>|jD]2}t||d<01>}|s<01>|j |j |<01><00><00>4|S)zj
Return a list of all nodes (within this node and its nodelist)
of the given type
N)r?r<><00>child_nodelistsr#<00>extend<6E>get_nodes_by_type)r-<00>nodetype<70>nodes<65>attrrQs r%rhzNode.get_nodes_by_type<70>s^<00><00>
<13><05> <15>d<EFBFBD>H<EFBFBD> %<25> <11>L<EFBFBD>L<EFBFBD><14> <1E><18>(<28>(<28>D<EFBFBD><1E>t<EFBFBD>T<EFBFBD>4<EFBFBD>0<>H<EFBFBD><17><15> <0C> <0C>X<EFBFBD>7<>7<><08>A<>B<>)<29><15> r$) rrrr<>rfrpr[rdrhr#r$r%r`r`<00>s"<00><00><1A>M<EFBFBD>#<23>O<EFBFBD> <10>E<EFBFBD> <0A> <12>4 r$r`c<00><00>eZdZdZd<02>Zd<03>Zy)r<>Fc
<00>z<00>tdj|D<00>cgc]}|j|<01><00><02>c}<02><00>Scc}w<00>NrW)r r<>rd)r-r]r<>s r%r[zNodeList.render<65>s3<00><00><19>"<22>'<27>'<27>d<EFBFBD>"S<>d<EFBFBD>d<EFBFBD>4<EFBFBD>#8<>#8<><17>#A<>d<EFBFBD>"S<>T<>U<>U<><55>"Ss<00>8 c<00>X<00>g}|D]"}|j|j|<01><00><00>$|S)z,Return a list of all nodes of the given type)rgrh)r-rirjr<>s r%rhzNodeList.get_nodes_by_type<70>s-<00><00><12><05><18>D<EFBFBD> <11>L<EFBFBD>L<EFBFBD><14>/<2F>/<2F><08>9<> :<3A><19><14> r$N)rrrr<>r[rhr#r$r%r<>r<><00>s<00><00><1D><14>V<01>r$r<>c<00>(<00>eZdZdZd<02>Zd<03>Zd<04>Zd<05>Zy)r<>r#c<00><00>||_yr)<00><01>s)r-rss r%r.zTextNode.__init__s <00><00><12><04>r$c<00>V<00>d|jj<00>d|jdd<00>d<04>S)Nr:rO<00>r;)r<rrsr0s r%r=zTextNode.__repr__s!<00><00>!<21>^<5E>^<5E>4<>4<>d<EFBFBD>f<EFBFBD>f<EFBFBD>S<EFBFBD>b<EFBFBD>k<EFBFBD>B<>Br$c<00><00>|jSr)rrr\s r%r[zTextNode.render s <00><00><13>v<EFBFBD>v<EFBFBD> r$c<00><00>|jS)z<>
Return the given value.
The default implementation of this method handles exceptions raised
during rendering, which is not necessary for text nodes.
rrr\s r%rdzTextNode.render_annotateds <00><00><14>v<EFBFBD>v<EFBFBD> r$N)rrrrfr.r=r[rdr#r$r%r<>r<>s<00><00><18>O<EFBFBD><13>C<01><16>r$r<>c<00><><00>t||j<00><01>}t||j<00><02>}|jr/t t |<00>t<00>s t|<00>}t|<00>St|<00>S)z<>
Convert any value to a string to become part of a rendered template. This
means escaping, if required, and conversion to a string. If value is a
string, it's expected to already be translated.
)r$)<01>use_l10n) rr$rryr <00>
issubclassrCrNr)r<>r]s r%<00>render_value_in_contextr{s[<00><00> <1F>u<EFBFBD>W<EFBFBD>^<5E>^<5E> <<3C>E<EFBFBD> <14>U<EFBFBD>W<EFBFBD>%5<>%5<> 6<>E<EFBFBD><0E><19><19><19>$<24>u<EFBFBD>+<2B>s<EFBFBD>+<2B><17><05>J<EFBFBD>E<EFBFBD>!<21>%<25>(<28>(<28><12>5<EFBFBD>z<EFBFBD>r$c<00>"<00>eZdZdZd<02>Zd<03>Zd<04>Zy)r<>r#c<00><00>||_yr)<00>r<>)r-r<>s r%r.zVariableNode.__init__+s
<00><00>!2<><04>r$c<00> <00>d|jzS)Nz<Variable Node: %s>r~r0s r%r=zVariableNode.__repr__.s<00><00>$<24>t<EFBFBD>'=<3D>'=<3D>=<3D>=r$c<00>p<00> |jj|<01>}t||<01>S#t$rYywxYwrn)r<>rr<>r{)r-r]<00>outputs r%r[zVariableNode.render1sB<00><00> <16><19>+<2B>+<2B>3<>3<>G<EFBFBD><<3C>F<EFBFBD> '<27>v<EFBFBD>w<EFBFBD>7<>7<><37> "<22> <16><16>  <16>s <00>)<00> 5<03>5N)rrrrfr.r=r[r#r$r%r<>r<>(s<00><00><18>O<EFBFBD>3<>><3E>8r$r<>z(?:(\w+)=)?(.+)c<00><><00>|siStj|d<00>}|xr|d}|s|siSt|<00>dks|ddk7riSi}|r<>|r:tj|d<00>}|r|ds|S|j<00>\}}|dd<02>=n't|<00>dks|ddk7r|S|d|d}}|dd<03>=|j |<07>||<|r|s|ddk7r|S|dd<02>=|r<01><>|S)aX
Parse token keyword arguments and return a dictionary of the arguments
retrieved from the ``bits`` token list.
`bits` is a list containing the remainder of the token (split by spaces)
that is to be checked for arguments. Valid arguments are removed from this
list.
`support_legacy` - if True, the legacy format ``1 as foo`` is accepted.
Otherwise, only the standard ``foo=1`` format is allowed.
There is no requirement for all remaining token ``bits`` to be keyword
arguments, so return the dictionary as soon as an invalid argument format
is reached.
rrr<00>asNr<00>and)<05>kwarg_rer<65>r<><00>groupsr<73>)r<>rt<00>support_legacyr<79><00> kwarg_format<61>kwargs<67>keyr<79>s r%<00> token_kwargsr<73>@s <00><00> <10><11> <09> <14>N<EFBFBD>N<EFBFBD>4<EFBFBD><01>7<EFBFBD> #<23>E<EFBFBD><18>%<25>U<EFBFBD>1<EFBFBD>X<EFBFBD>L<EFBFBD> <17><1D><15>I<EFBFBD> <0E>t<EFBFBD>9<EFBFBD>q<EFBFBD>=<3D>D<EFBFBD><11>G<EFBFBD>t<EFBFBD>O<EFBFBD><15>I<EFBFBD> <0F>F<EFBFBD>
<0E> <17><1C>N<EFBFBD>N<EFBFBD>4<EFBFBD><01>7<EFBFBD>+<2B>E<EFBFBD><18><05>a<EFBFBD><08><1D> <0A><1E><1C><1C><1E>J<EFBFBD>C<EFBFBD><15><14>R<EFBFBD>a<EFBFBD>R<EFBFBD><08><12>4<EFBFBD>y<EFBFBD>1<EFBFBD>}<7D><04>Q<EFBFBD><07>4<EFBFBD><0F><1D> <0A><1D>a<EFBFBD><17>$<24>q<EFBFBD>'<27><15>C<EFBFBD><14>R<EFBFBD>a<EFBFBD>R<EFBFBD><08><1C>+<2B>+<2B>E<EFBFBD>2<><06>s<EFBFBD> <0B> <0F> <0C><13>A<EFBFBD>w<EFBFBD>%<25><1F><1D> <0A><14>R<EFBFBD>a<EFBFBD>R<EFBFBD><08>! <0F>" <12>Mr$r8)Gr9r-<00>logging<6E>re<72>enumr<00>django.template.contextr<00>django.utils.formatsr<00>django.utils.htmlr<00>django.utils.regex_helperr<00>django.utils.safestringrr r
<00>django.utils.textr r r <00>django.utils.timezoner<00>django.utils.translationrr<00>
exceptionsr<00>FILTER_SEPARATOR<4F>FILTER_ARGUMENT_SEPARATORrHr<><00> BLOCK_TAG_ENDr<44><00>VARIABLE_TAG_ENDr<44><00>COMMENT_TAG_END<4E>SINGLE_BRACE_START<52>SINGLE_BRACE_ENDrL<00>compiler<65><00> getLoggerr]rrnr'r3rGr<>r<>rgrfri<00>escape<70>constant_stringrY<00>filter_raw_string<6E>VERBOSErrrr`r<>r<>r<>r{r<>r<>r<>r#r$r%<00><module>r<>s<00><01>2<04>h<0F><0E> <09><15>/<2F>)<29>0<>6<>C<>C<>Q<>Q<>4<>@<40>+<2B><17><10><1F><19>"<22><1C><16><0F><14> <0A><19><12><17><10><18><11><16><0F><18><12><16><10>$<24><0E>
<14><12><1A><1A>0<> 1<><06> <1A><17> <1A> <1A>,<2C> -<2D><06><10><04><10>&<26>9<EFBFBD>&<26><0E><0E>8N
<EFBFBD>N
<EFBFBD>b#<23>-<15>-<15>`:E<01>:E<01>z<16><15><16>DtL<01>tL<01>t<04> )<29> (<28><1A><12><19><19>4<EFBFBD><1F><1B>"<22>)<29>)<29>C<EFBFBD>.<2E> <02>
<02><0F>"<22>)<29>)<29>$<24><02>3<><0F> <06> <20> <1D><18><1B>"<22>)<29>)<29>,<2C>-<2D><18>r<EFBFBD>y<EFBFBD>y<EFBFBD>2<>3<>  <02><02><11>& <1D>.<2E><02>
<EFBFBD>
<EFBFBD> ;<3B> <09>|E<01>|E<01>~j<17>j<17>Z3<15>3<15>l <15>t<EFBFBD> <15> <16>t<EFBFBD><16>, <1A> 8<>4<EFBFBD>8<>* <1C>.<2E> /<2F><08>,r$