fdZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ddl m Z dd l mZdd l mZdd lmZdd lmZdd lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZej<dZej<dej@dejBfZ"ejFr#ddl$Z$ddl%Z&ddl'm(Z(Gdde&jRZ*gdZ+gdZ,ded efd!Z-d"ej\ejBd e/fd#Z0d"ej\ejBd e/fd$Z1 dHd%d&d'ejde/d(ejfe/ej@d)gejhe/ffd*ejdejfe/ejBfd+e5d,ejdejle/ejBfd-ejdejne/ejBfd d)fd.Z8Gd/d0Z9d1e"d e"fd2Z:ejnjvGd3d)Z<Gd4d5Z=Gd6d7Z>Gd8d9e>Z?Gd:d;Z@Gd<d=ZAdeAfd>ejdd?d@ejeAd ejeAfdAZCGdBdCeAZDGdDdEeAZEGdFdGeAZFeA`GeD`GeE`GeF`Gy)Iz;The runtime functions and state used by compiled templates.N)abc)chain)escape)Markup)soft_str auto_aiter) auto_await)TemplateNotFound)TemplateRuntimeError)UndefinedError) EvalContext)_PassArg)concat) internalcode)missing) Namespace)object_type_repr)pass_eval_contextVF.)bound) Environmentc BeZdZ ddejedddedefdZy)LoopRenderFuncreciterloop_render_funcdepthreturncyN)selfrrrs W/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/jinja2/runtime.py__call__zLoopRenderFunc.__call__&s N)r) __name__ __module__ __qualname__tIterablerintstrr&r#r'r%rr%s:   ZZ] /      r'r) LoopContextTemplateReferenceMacrorr rr markup_joinstr_joinidentityr r Undefinedr)AsyncLoopContextr r xr c|S)zLReturns its argument. Useful for certain things in the environment. r#)r7s r%r4r4Fs  Hr'seqcg}tt|}|D]E}|j|t|ds!t dj t ||cSt|S)z?Concatenation that escapes if necessary and converts to string.__html__)maprappendhasattrrjoinrr)r9bufiteratorargs r%r2r2MsX C8S!H 3 3 #":??5h#78 8 #;r'c4ttt|S)z3Simple args to string conversion and concatenation.)rr=r.)r9s r%r3r3Xs #c3-  r' environmentr template_nameblocksContextvarssharedglobalslocalsc|i}|r|}nt|xsdfi|}|r3|r t|}|jD]\}} | tus| ||<|j|||||S)z%Internal helper for context creation.r#)rK)dictitemsr context_class) rErFrGrIrJrKrLparentkeyvalues r% new_contextrT]s | gm,t,  &\F ,,.JCG##s )  $ $V]FG % r'cHeZdZdZddZdedejfdZdefdZ y) r0zThe `self` in templates.r Nc||_yr")_TemplateReference__context)r$contexts r%__init__zTemplateReference.__init__}s  r'namecd|jj|}t||j|dSNr)rWrGBlockReference)r$rZrGs r% __getitem__zTemplateReference.__getitem__s+&&t,dDNNFA>>r'cbdt|jd|jjdS)N< >)typer(rWrZr$s r%__repr__zTemplateReference.__repr__s-4:&&'q)<)<(?qAAr')rXrHr N) r(r)r*__doc__rYr.r+Anyr^rer#r'r%r0r0zs/"!???B#Br'r0 dict_methodctjdddtjffd }tjt |S)Nr$rHr c0|jSr")get_all)r$rhs r%f_allz_dict_method_all..f_alls4<<>**r') functoolswrapsr+rgcastr)rhrls` r%_dict_method_allrpsC__[!+I+!%%+"+ 66!U r'c`eZdZdZ d dddej eejfdejedej eejdgejeffdejejeejff d Z ded ejdgejefd ejd fd Zd dedejd ejfdZded ejejdffdZded ejfdZd ej eejffdZd ej eejffdZedejdejfdejdejd ejejdffdZd dejej eejfd dfdZeej2Zeej4Zeej6Zded efdZded ejfdZd efdZy)!rHaThe template context holds the variables of a template. It stores the values passed to the template and also the names the template exports. Creating instances is neither supported nor useful as it's created automatically at various stages of the template evaluation and should not be created by hand. The context is immutable. Modifications on :attr:`parent` **must not** happen and modifications on :attr:`vars` are allowed from generated template code only. Template filters and global functions marked as :func:`pass_context` get the active context passed as first argument and are allowed to access the context read-only. The template context supports read only dict operations (`get`, `keys`, `values`, `items`, `iterkeys`, `itervalues`, `iteritems`, `__getitem__`, `__contains__`). Additionally there is a :meth:`resolve` method that doesn't fail with a `KeyError` but returns an :class:`Undefined` object for missing variables. NrErrQrZrGrKc(||_i|_||_t|j||_t |_||_| t n t ||_|jDcic] \}}||g c}}|_ ycc}}wr") rQrIrEreval_ctxset exported_varsrZ globals_keysrOrG)r$rErQrZrGrKkvs r%rYzContext.__init__sz (* *5#D$4$4d; ), %,_CE#g, +1,,.9$!Qq1#v9 9s6Bcurrentr r]r5c |j|}|j|dz}||t ||||S#t$r$|jj d|ddcYSwxYw)zRender a parent block.r there is no parent block called .superrZ)rGindex LookupErrorrE undefinedr])r$rZryrGrs r%r~z Context.supers [[&FLL)A-E 5M dD&%88  ##--24(!<7.  s(8*A%$A%rRdefaultc0 ||S#t$r|cYSwxYw)zLook up a variable by name, or return a default if the key is not found. :param key: The variable name to look up. :param default: The value to return if the key is not found. )KeyError)r$rRrs r%getz Context.gets% 9  N s  r5cp|j|}|tur|jj|S|S)aNLook up a variable by name, or return an :class:`Undefined` object if the key is not found. If you need to add custom behavior, override :meth:`resolve_or_missing`, not this method. The various lookup functions use that method, not this one. :param key: The variable name to look up. r)resolve_or_missingrrEr)r$rRrvs r%resolvezContext.resolves: $ $S ) =##--3-7 7 r'c||jvr|j|S||jvr|j|StS)aNLook up a variable by name, or return a ``missing`` sentinel if the key is not found. Override this method to add custom lookup behavior. :meth:`resolve`, :meth:`get`, and :meth:`__getitem__` use this method. Don't call this method directly. :param key: The variable name to look up. )rIrQr)r$rRs r%rzContext.resolve_or_missings> $)) 99S> ! $++ ;;s# #r'c\|jDcic]}||j|c}Scc}w)z+Get a new dict with the exported variables.)rurI)r$rws r% get_exportedzContext.get_exporteds()-);); yy;; {{99 DKK-499--r' _Context__obj.argskwargsc d}t|dr+tj|j |j}tj|}|tjurQ|j dr|j |d}|j dr|j |d}|f|z}nE|tjur|jf|z}n"|tjur|jf|z}|jdd|jdd ||i|S#t$r|jjdcYSwxYw)zCall the callable with the arguments and keyword arguments provided but inject the active context or environment as first argument if the callable has :func:`pass_context` or :func:`pass_environment`. Tr&N _loop_vars _block_varszGvalue was undefined because a callable raised a StopIteration exception) r?rfrom_objr&rXrderived eval_contextrsrEpop StopIterationr)_Context__selfrrr__traceback_hide__pass_args r%callz Context.calls? !%  E: &!!%..1=NNE$$U+ x'' 'zz,'|(<=zz-(}(=>9t#D .. .OO%,D -- -&&(4/D =$' <& $)&) ) %%//+  sD%%$E  E rLc t|j|ji|jdd|}|j|_|j j d|j jD|S)zInternal helper function to create a derived context. This is used in situations where the system needs a new context in the same template that is independent. TNc3<K|]\}}|t|fywr")list).0rwrxs r% z"Context.derived..?sKtq!q$q'lKs)rTrErZrkrsrGupdaterO)r$rLrXs r%rzContext.derived6se    diiT\\^T4  ==Kt{{7H7H7JKKr'c>||jvxs||jvSr")rIrQr$rZs r% __contains__zContext.__contains__Fstyy 7DDKK$77r'cN|j|}|tur t||S)zpLook up a variable by name with ``[]`` syntax, or raise a ``KeyError`` if the key is not found. )rrr)r$rRitems r%r^zContext.__getitem__Is*&&s+ 7?3-  r'cpdt|jd|jd|jdS)Nr`raz of rb)rcr(rkrZrds r%rezContext.__repr__Ts34:&&'q(:$tyym1MMr'r") r(r)r*rfr+Dictr.rgOptionalCallableIteratorMutableMappingrYUnionr~rrrrrkrrrrprNkeysvaluesrOboolrr^rer#r'r%rHrHsk2=A :":sAEEz":jjo : sAJJ {AJJsO'CDDE : A,,S!%%Z89 :* 9 9"#**i[!**S/-I"J 9 . / 9 s QUU aee 3177155++=#>"caee$=affS!%%Z0= .QUU + .-zz#quu*%-uu-%% -  # $ --^ ajjQUU );<   DII &D dkk *F TZZ (E888 s quu N#Nr'c eZdZdZdedddej ejdgejefde ddf d Z e dejd fd Z edefd Zedefd Zy)r]z"One block on a template reference.rZrXrHstackrr Nc<||_||_||_||_yr")rZ_context_stack_depth)r$rZrXrrs r%rYzBlockReference.__init__[s     r'rzc(|jdzt|jk\r5|jjj d|j ddSt|j |j|j|jdzS)zSuper the block.rr|r}r~r)rlenrrrErrZr]rds r%r~zBlockReference.supergsy ;;?c$++. .==,,662499-qA7 dii T[[ST_UUr'cKt|j|j|j2cgc3d{}| 76ncc}wc}}|jjj r t |S|Swr")rrrrrs autoescaper)r$r7rs r% _async_callzBlockReference._async_callpsd 6dkk$++6t}}E F FQ F F F  == ! ! , ,":  s01A>AA AA AA A:A>c |jjjr|jSt |j |j |j}|jjjr t|S|Sr") rrEis_asyncrrrrrsrrr$rs r%r&zBlockReference.__call__{si == $ $ - -##% % ,DKK ,T]]; < == ! ! , ,":  r')r(r)r*rfr.r+Listrrr-rYpropertyrr~rrr&r#r'r%r]r]Xs,   vvajj)ajjo!=>?     Vqww<=VV3 #  r'r]c eZdZUdZdZdZejee d<e Z eje d<e Z eje d<e Zeje d<e Zeje d< d%d ej ed ej$d d ejd deddf dZed ej edej*efdZedefdZdefdZedefdZedefdZedefdZedefdZedefdZdejfdZ edefdZ!edejDejd ffdZ#edejDejd ffdZ$dedefdZ%dejdefd Z&d&d!Z'dejPejdffd"Z)e*d ej ede+fd#Z,de+fd$Z-y)'r/zeA wrapper iterable for dynamic ``for`` loops, with information about the loop and iteration. N_length_after_current_before_last_changed_valueiterablerr5recurserdepth0r ch||_|j||_||_||_||_y)a@ :param iterable: Iterable to wrap. :param undefined: :class:`Undefined` class to use for next and previous items. :param recurse: The function to render the loop body when the loop is marked recursive. :param depth0: Incremented when looping recursively. N) _iterable _to_iterator _iterator _undefined_recurser)r$rrrrs r%rYzLoopContext.__init__s2"**84#  r'ct|Sr")iterrs r%rzLoopContext._to_iterators H~r'cj|j |jS t|j|_|jS#t$rit |j }|j ||_t||jz|jtuz|_Y|jSwxYw)zLength of the iterable. If the iterable is a generator or otherwise does not have a size, it is eagerly evaluated to get a size. ) rrr TypeErrorrrrrrrr$rs r%lengthzLoopContext.lengths << #<<  Ut~~.DL ||  UDNN+H!..x8DNx=4::5G9STDL||  UsAA$B21B2c|jSr")rrds r%__len__zLoopContext.__len__s {{r'c |jdzS)zBHow many levels deep a recursive loop currently is, starting at 1.r)rrds r%rzLoopContext.depth{{Qr'c |jdzS)z-Current iteration of the loop, starting at 1.rindex0rds r%rzLoopContext.indexrr'c4|j|jz S)zrNumber of iterations from the end of the loop, ending at 0. Requires calculating :attr:`length`. rrrds r% revindex0zLoopContext.revindex0s {{TZZ''r'c4|j|jz S)zrNumber of iterations from the end of the loop, ending at 1. Requires calculating :attr:`length`. rrrds r%revindexzLoopContext.revindexs {{T[[((r'c |jdk(S)z0Whether this is the first iteration of the loop.rrrds r%firstzLoopContext.firsts{{ar'c|jtur |jSt|jt|_|jS)a Return the next element in the iterable, or :data:`missing` if the iterable is exhausted. Only peeks one item ahead, caching the result in :attr:`_last` for use in subsequent checks. The cache is reset when :meth:`__next__` is called. )rrnextrrds r% _peek_nextzLoopContext._peek_nexts6 ;;g %;; 4>>73 {{r'c.|jtuS)zWhether this is the last iteration of the loop. Causes the iterable to advance early. See :func:`itertools.groupby` for issues this can cause. The :func:`groupby` filter avoids that issue. rrrds r%lastzLoopContext.lasts G++r'cT|jr|jdS|jS)zZThe item in the previous iteration. Undefined during the first iteration. zthere is no previous item)rrrrds r%previtemzLoopContext.previtems% ::??#>? ?||r'cX|j}|tur|jdS|S)a The item in the next iteration. Undefined during the last iteration. Causes the iterable to advance early. See :func:`itertools.groupby` for issues this can cause. The :func:`jinja-filters.groupby` filter avoids that issue. there is no next itemrrrrs r%nextitemzLoopContext.nextitems,__  =??#:; ; r'rcR|s td||jt|zS)zReturn a value from the given args, cycling through based on the current :attr:`index0`. :param args: One or more values to cycle through. zno items for cycling given)rrr)r$rs r%cyclezLoopContext.cycles+ 89 9DKK#d)+,,r'rSc2|j|k7r||_yy)zReturn ``True`` if previously called with a different value (including when called for the first time). :param value: One or more values to compare to the last call. TF)r)r$rSs r%changedzLoopContext.changed s  # #u ,',D $r'c|Sr"r#rds r%__iter__zLoopContext.__iter__, r'c|jtur|j}t|_nt|j}|xjdz c_|j |_||_||fSNr)rrrrrrrrs r%__next__zLoopContext.__next__/sU ;;g %B!DKdnn%B q }}  4xr'c|j td|j||j|jS)zWhen iterating over nested data, render the body of the loop recursively with the given inner iterable data. The loop must have the ``recursive`` marker for this to work. zCThe loop must have the 'recursive' marker to be called recursively.)r)rrrrs r%r&zLoopContext.__call__;s= == U }}Xt}}DJJ}GGr'chdt|jd|jd|jdS)Nr`ra/rb)rcr(rrrds r%rezLoopContext.__repr__Is04:&&'q Adkk]!DDr'r\)r r/).r(r)r*rfrrr+rr-__annotations__rrrgrrrr,rTyperY staticmethodrrrrrrrrrrrrrrrrrrrTuplerrr.r&rer#r'r%r/r/s F#GQZZ_#FAEEHaeeGQUU!(( 15 **Q-66+&,-     ,qzz!}A$ss(3(()#)) t   AEE ,d,,!''!%%"45 !''!%%"45   -1 - - aee   !''!%%"67  HA H3 H HE#Er'r/ceZdZUejej ed<edejeje eje fdeje fdZ e defdZe defdZe defdZdej fdZe defd Ze dejej d ffd Zdd Zdej.ej dffd Zy)r6rrr ct|Sr"r rs r%rzAsyncLoopContext._to_iteratorPs(##r'cK|j |jS t|j|_|jS#t$rz|j2cgc3d{7}| 6ncc}w}}|j ||_t||j z|jtuz|_Y|jSwxYwwr") rrrrrrrrr)r$r7rs r%rzAsyncLoopContext.lengthVs << #<<  Ut~~.DL ||  U)-88A88H8!..x8DNx=4::5G9STDL||  UsLCA CCA*A(A" A($A*)AC7 CCCcPK|jd{|jz S7wr"rrds r%rzAsyncLoopContext.revindex0ds[[ 4::-- &$&cPK|jd{|jz S7wr"rrds r%rzAsyncLoopContext.revindexhs[[ 4;;.. r cK|jtur |jS |jjd{|_|jS7#t$rt|_Y|jSwxYwwr")rrr __anext__StopAsyncIterationrds r%rzAsyncLoopContext._peek_nextlsh ;;g %;;  " $ 8 8 ::DK{{ ;! "!DK{{ "s9A<AA A A<AA9+ A<8A99A<cJK|jd{tuS7 wr"rrds r%rzAsyncLoopContext.lastws__&&'11&s #! #r5ctK|jd{}|tur|jdS|S7w)Nrrrs r%rzAsyncLoopContext.nextitem{s6??$ $ =??#:; ; %s 86 8c|Sr"r#rds r% __aiter__zAsyncLoopContext.__aiter__rr'cK|jtur|j}t|_n"|jjd{}|xjdz c_|j |_||_||fS75wr)rrrr rrrrs r%r zAsyncLoopContext.__anext__se ;;g %B!DK~~//11B q }}  4x 2sAB B 6BN)r r6)r(r)r*r+ AsyncIteratorrgrrrr,r AsyncIterablerrr-rrrrrrrrrr r#r'r%r6r6Ms,quu%%$''!**Q-);;<$  $$  c  .../// !%% 2D22{(: ; 0B)B!C r'r6cneZdZdZ ddddej defdedejed ed ed ed ejefd Z e e dejdejdefdZdejejdedefdZdejejdedefdZdefdZy)r1zWraps a macro function.NrErfunc.rZ arguments catch_kwargs catch_varargscallerdefault_autoescapec ||_||_t||_||_||_||_||_||_d|v|_ |:t|jr|jd}||_ y|j}||_ y)Nr) _environment_funcr_argument_countrZrrrrexplicit_callercallabler_default_autoescape) r$rErrZrrrrrs r%rYzMacro.__init__s( "9~ "(* '94  % ../%0%;%;D%A"$6 &1%;%;"#5 r'rrr c &|r(t|dtr|dj}|dd}n |j}t |d|j }t |}d}||j k7rH|jt |dD],} |j|}|dk(rd}|j|.n |j}|jrD|sB|jdd} | |jjdd} |j| |j r|j|nL|rJd|vrt#d|j$d t#d|j$d t't)||j*r|j||j dnGt ||j kDr/t#d|j$d t |jd |j-||S#t$r t}YwwxYw) NrrFrTzNo caller definedrzmacro zX was invoked with two values for the special caller argument. This is most likely a bug.z takes no keyword argument z takes not more than z argument(s)) isinstancerrr#rr rrrrrr>r!rrrrrrZrrr_invoke) r$rrrroff found_callerrZrSrs r%r&zMacro.__call__s& JtAw 4a++J8D11J4 4 456 )n $&& &s9~'78$"JJt,E8##'L  '9 //L ;;|ZZ$/F~**445Hx4X   V $      V $ 6!TYYM*CC %@d6lAS@VW       T$"6"6"89 : Y-- - &'( 6  ||Iz22I $#E$sG==HHrcZK|j|d{}|r t|S|S7wr")rrr$rrrs r% _async_invokezMacro._async_invokes04::y) ) ":  *s +)+c|jjr|j||S|j|}|r t |}|Sr")rrr+rrr*s r%r&z Macro._invoke sE    % %%%i< < TZZ # B r'c|jdnt|j}dt|jd|dS)N anonymousr`rarb)rZreprrcr(rs r%rezMacro.__repr__s:"ii/{T$))_4:&&'qa00r'r")r(r)r*rfr+rr.rrrrYrrrgr&r+r&rer#r'r%r1r1s!046"6jjc"6 6 66#; 6  666JJt,6:J3aeeJ3quuJ3J3J3XQVVAEE]QT  D S 1#1r'r1c eZdZdZdZdedefdeje dejdeje deje ddf d Z ede fd Zed ejd ejdd fdZede dejfdZexZxZxZZexZxZxZZexZZexZZexZZ exZ!Z"exZ#Z$exZ%xZ&xZ'Z(exZ)xZ*Z+exZ,Z-dejde.fdZ/dejde.fdZ0de1fdZ2de fdZ3de1fdZ4dejjejfdZ6dejnejfdZ8de.fdZ9de fdZ:y)r5ahThe default undefined type. This undefined type can be printed and iterated over, but every other access will raise an :exc:`UndefinedError`: >>> foo = Undefined(name='foo') >>> str(foo) '' >>> not foo True >>> foo + 42 Traceback (most recent call last): ... jinja2.exceptions.UndefinedError: 'foo' is undefined _undefined_hint_undefined_obj_undefined_name_undefined_exceptionNhintobjrZexcr c<||_||_||_||_yr"r1)r$r6r7rZr8s r%rYzUndefined.__init__0s$ $!#$'!r'c8|jr |jS|jtur|jdSt |jt s$t |jd|jSt |jd|jS)zXBuild a message about the undefined value based on how it was accessed. z is undefinedz has no element z has no attribute )r2r3rr4r%r.rrds r%_undefined_messagezUndefined._undefined_message<s   '' '   ' )**-]; ;$..4#D$7$789: 0035    3 3478..1 3 r'rr te.NoReturnc8|j|j)zeRaise an :exc:`UndefinedError` when operations are performed on the undefined value. )r5r;)r$rrs r%_fail_with_undefined_errorz$Undefined._fail_with_undefined_errorRs''(?(?@@r'cH|dddk(r t||jS)N__)AttributeErrorr>rs r% __getattr__zUndefined.__getattr__[s* 8t  & &..00r'otherc.t|t|uSr")rcr$rDs r%__eq__zUndefined.__eq__msDzT%[((r'c&|j| Sr")rGrFs r%__ne__zUndefined.__ne__ps;;u%%%r'c*tt|Sr")idrcrds r%__hash__zUndefined.__hash__ss$t*~r'cy)Nr<r#rds r%__str__zUndefined.__str__vsr'cyr\r#rds r%rzUndefined.__len__ysr'c#$KdEd{y7wNr#r#rds r%rzUndefined.__iter__|s  s c$KdD]}d ywrQr#r$_s r%rzUndefined.__aiter__sA scy)NFr#rds r%__bool__zUndefined.__bool__sr'cy)Nr5r#rds r%rezUndefined.__repr__sr');r(r)r*rf __slots__rrr+rr.rgrr rYrr;rr>rC__add____radd____sub____rsub____mul____rmul____div____rdiv__ __truediv__ __rtruediv__ __floordiv__ __rfloordiv____mod____rmod____pos____neg__r&r^__lt____le____gt____ge____int__ __float__ __complex____pow____rpow__rrGrIr-rLrNrrrrrrVrer#r'r%r5r5s I!% $,: (jjo (UU (jjo ( VV( ) (  ( C  *AUUA&'eeA AA1111 /IHGHhH8.HHGHhH8!;;K,#==L=33Gh22Gg77H{(BBFBVBfv(BBGBi+33Gh)AEE)d)&AEE&d&#!**QUU+!7$#r'r5loggerzlogging.LoggerbasecIddl}|jtj|jt j dtddffd Gfdd|}|S)akGiven a logger object this returns a new undefined class that will log certain failures. It will log iterations and printing. If no logger is given a default logger is created. Example:: logger = logging.getLogger(__name__) LoggingUndefined = make_logging_undefined( logger=logger, base=Undefined ) .. versionadded:: 2.8 :param logger: the logger to use. If not provided, a default logger is created. :param base: the base class to add logging functionality to. This defaults to :class:`Undefined`. Nrundefr c>jd|jy)NzTemplate variable warning: %s)warningr;)rurrs r% _log_messagez,make_logging_undefined.._log_messages68P8PQr'ceZdZdZdej dej ddffd Zdeffd Zdejej ffd Z de ffd Z xZ S) 0make_logging_undefined..LoggingUndefinedr#rrr r<c| t||i|y#|j$r}jd||d}~wwxYw)NzTemplate variable error: %s)r~r>r5error)r$rre __class__rrs r%r>zKmake_logging_undefined..LoggingUndefined._fail_with_undefined_errorsD 2DCFC,,  :A> s;6;c0|t|Sr")r~rNr$r~rxs r%rNz8make_logging_undefined..LoggingUndefined.__str__s  7?$ $r'c0|t|Sr")r~rrs r%rz9make_logging_undefined..LoggingUndefined.__iter__  7#% %r'c0|t|Sr")r~rVrs r%rVz9make_logging_undefined..LoggingUndefined.__bool__rr')r(r)r*rXr+rgr>r.rNrrrrV __classcell__)r~rxrrs@r%LoggingUndefinedrzsc   *+%%    %S % &ajj/ & &d & &r'r)logging getLoggerr( addHandler StreamHandlersysstderrr5)rrrsrrrxs` @r%make_logging_undefinedrsi,~"""8,/'// ;<RIR$R&4&0 r'c4eZdZdZdZdefdZdeddfdZeZy)ChainableUndefinedaAn undefined that is chainable, where both ``__getattr__`` and ``__getitem__`` return itself rather than raising an :exc:`UndefinedError`. >>> foo = ChainableUndefined(name='foo') >>> str(foo.bar['baz']) '' >>> foo.bar['baz'] + 42 Traceback (most recent call last): ... jinja2.exceptions.UndefinedError: 'foo' is undefined .. versionadded:: 2.11.0 r#r ct|Sr")r.rds r%r;zChainableUndefined.__html__s 4yr'rTc|Sr"r#rSs r%rCzChainableUndefined.__getattr__rr'N) r(r)r*rfrXr.r;rCr^r#r'r%rrs5 I#S%9Kr'rc eZdZdZdZdefdZy)DebugUndefinedaAn undefined that returns the debug info when printed. >>> foo = DebugUndefined(name='foo') >>> str(foo) '{{ foo }}' >>> not foo True >>> foo + 42 Traceback (most recent call last): ... jinja2.exceptions.UndefinedError: 'foo' is undefined r#r c|jrd|j}nE|jtur |j}n&dt |jd|jd}d|dS)Nzundefined value printed: zno such element: []z{{ z }})r2r3rr4r)r$messages r%rNzDebugUndefined.__str__sx   1$2F2F1GHG  G +**G$$4T5H5H$I#JD((+1.  wiu%%r'N)r(r)r*rfrXr.rNr#r'r%rrs I & &r'rcpeZdZdZdZej xZxZZ ej xZ xZ xZ Z ej Zy)StrictUndefinedasAn undefined that barks on print and iteration as well as boolean tests and all kinds of comparisons. In other words: you can do nothing with it except checking if it's defined using the `defined` test. >>> foo = StrictUndefined(name='foo') >>> str(foo) Traceback (most recent call last): ... jinja2.exceptions.UndefinedError: 'foo' is undefined >>> not foo Traceback (most recent call last): ... jinja2.exceptions.UndefinedError: 'foo' is undefined >>> foo + 42 Traceback (most recent call last): ... jinja2.exceptions.UndefinedError: 'foo' is undefined r#N)r(r)r*rfrXr5r>rrNrrGrIrVrLrr#r'r%rrsH&I#,#G#GGHGw,5,P,PPFPVPh77Lr'r)NFNN)Hrfrmrtypingr+ collectionsr itertoolsr markupsaferrr async_utilsr r exceptionsr r rnodesrutilsrrrrrrrTypeVarrrrgr TYPE_CHECKINGrtyping_extensionsterErProtocolrexportedasync_exportedr4r,r.r2r3rrrrrMappingrTr0rpregisterrHr]r/r6r1r5rrrrrrXr#r'r%rsA ##(,&#$ AIIcN AIIcCJ/0??"(    a QZZ&3!!**QUU#!!,08<04::c? FF3 I; 3#?@@ A **QVVCJ' (    ZZ((aee4 5  JJqyyaee, -: B B!DNDNDNN--`BEBEJD{DNC1C1Lmmb,097 JJ' (778vvi7H7VVI7t6&Y&@8i8: r'