U.C8ddlZddlmZddlmZddlmZddlmZddlm Z ddl m Z dd l m Z dd l m Z dd lmZdd lmZd ejejdejejfdZGdde ZGddeZGddeZee_dS)N) literal_eval)parse)chain)islice)nodes) CodeGenerator)Frame) has_safe_repr) Environment)Templatevaluesreturnctt|d}|sdSt|dkr |d}t|ts|Sn-ddt ||D} tt|dS#tttf$r|cYSwxYw) anReturn a native Python type from the list of compiled nodes. If the result is a single node, its value is returned. Otherwise, the nodes are concatenated as strings. If the result can be parsed with :func:`ast.literal_eval`, the parsed value is returned. Otherwise, the string is returned. :param values: Iterable of outputs to concatenate. Nrrc,g|]}t|Sstr.0vs d/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/jinja2/nativetypes.py z!native_concat.."s;;;!s1vv;;;eval)mode) listrlen isinstancerjoinrrr ValueError SyntaxError MemoryError)rheadraws r native_concatr(s vq!! " "D t 4yyA~~1g#s## J gg;;uT6':':;;;<< #F # # #     [ 1 sB!!B=<B=ceZdZdZedejdejfdZdejejde fdZ de j de d ejdejfd Zde j de d ejdd fd Zde j de d ejdd fd Zd S)NativeCodeGeneratorzaA code generator which renders Python types by not adding ``str()`` around output nodes. valuerc|SNr)r+s r_default_finalizez%NativeCodeGenerator._default_finalize4s rgroupcZtdd|DS)Nrc,g|]}t|Srrrs rrz:NativeCodeGenerator._output_const_repr..9s333SVV333r)reprr")selfr/s r_output_const_reprz&NativeCodeGenerator._output_const_repr8s+BGG33U33344555rnodeframefinalizec||j}t|stjt |tjr|S||Sr-)as_consteval_ctxr r Impossibler! TemplateDataconst)r3r5r6r7r=s r_output_child_to_constz*NativeCodeGenerator._output_child_to_const;sb en--U## %"$$ $ dE. / / L~~e$$$rNcL|j||jdSdSr-srcwriter3r5r6r7s r_output_child_prez%NativeCodeGenerator._output_child_preHs. < # JJx| $ $ $ $ $ $ #rcB|j|ddSdS)N)r@rCs r_output_child_postz&NativeCodeGenerator._output_child_postNs' < # JJsOOOOO $ #r)__name__ __module__ __qualname____doc__ staticmethodtAnyr.Iterablerr4rExprr r _FinalizeInfor>rDrGrrrr*r*/s(15\6 15(96c6666 %J %', %8E8S %  % % % %%J%',%8E8S% %%%% J',8E8S rr*ceZdZdZeZdS)NativeEnvironmentz=An environment that renders templates to native Python types.N)rHrIrJrKr*code_generator_classrrrrSrSUsGG.rrScveZdZeZdejdejdejfdZdejdejdejfdZdS)NativeTemplateargskwargsrc|t|i|} t||S#t$r|jcYSwxYw)aBRender the template to produce a native Python type. If the result is a single node, its value is returned. Otherwise, the nodes are concatenated as strings. If the result can be parsed with :func:`ast.literal_eval`, the parsed value is returned. Otherwise, the string is returned. ) new_contextdictr(root_render_func Exception environmenthandle_exceptionr3rWrXctxs rrenderzNativeTemplate.render^s{tT4V4455 7 !6!6s!;!;<< < 7 7 7#4466 6 6 6 7s!A#A)(A)c2K|jjstd|t |i|} t d||2d{VS#t$r|jcYSwxYw)Nz8The environment was not created with async mode enabled.c"Kg|3d{V}| 6Sr-r)rns rrz/NativeTemplate.render_async..vs.========Q====s) r^is_async RuntimeErrorrZr[r(r\r]r_r`s r render_asynczNativeTemplate.render_asyncls( J tT4V4455 7 ==$"7"7"<"<=========  7 7 7#4466 6 6 6 7s1A00#BBN) rHrIrJrSenvironment_classrMrNrbrhrrrrVrV[sx) 7AE 7QU 7qu 7 7 7 7 7 7 715 7 7 7 7 7 7rrV)typingrMastrr itertoolsrrrrcompilerr r r r^r r rOrNOptionalr(r*rSrVtemplate_classrrrrps############$$$$$$!!!!!!!*QU+ 150A@#####-###L///// /// 77777X777B$2 r