/opt/cloudlinux/venv/lib/python3.11/site-packages/jinja2/__pycache__
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/jinja2/__pycache__/meta.cpython-311.pyc (5719B)
§
æ3Ôå/’>ã ó` — d Z ddlZddlmZ ddlmZ ddlmZ ej rddl m
Z
G d„ d e¦ « Zd
ej dej
e fd„Zej ej ej ej fZej ej ej ej ej f Zd
ej dej ej e fd
„ZdS )z_Functions that expose information about templates that might be
interesting for introspection.
é Né )Únodes)Ú
CodeGenerator)ÚFrame)ÚEnvironmentc óH ‡ — e Zd ZdZdˆ fd„Zdeddfd„Zd eddfˆ fd
„Zˆ xZ S )ÚTrackingCodeGeneratorz.We abuse the code generator for introspection.Úenvironmentr ÚreturnNc ót •— t ¦ « |dd¦ « t ¦ « | _ d S )Nz
)ÚsuperÚ__init__ÚsetÚundeclared_identifiers)Úselfr
Ú __class__s €ú]/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/jinja2/meta.pyr zTrackingCodeGenerator.__init__ s3 ø€ Ý
‰Œ×Ò˜Ð&7Ð9JÑKÔKÐKÝ25±%´%ˆÔ#Ð#Ð#ó Úxc ó — dS )zDon't write.N© )r r s r ÚwritezTrackingCodeGenerator.write s € € € r Úframec óô •— t ¦ « |¦ « |j j ¦ « D ]6\ }\ }}|dk r(|| j j vr| j |¦ « Œ7dS )z$Remember all undeclared identifiers.ÚresolveN) r
Úenter_frameÚsymbolsÚloadsÚitemsr
Úglobalsr Úadd)r r Ú_ÚactionÚparamr s €r r z!TrackingCodeGenerator.enter_frame s� ø€ å
‰Œ×Ò˜EÑ"Ô"Ð"à"'¤-Ô"5×";Ò";Ñ"=Ô"=ð 7ð 7шA‰�˜Ø˜Ò"Ð" u°DÔ4DÔ4LÐ'LÐ'LØÔ+×/Ò/°Ñ6Ô6Ð6øð 7ð 7r )r
r r N)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r Ústrr r r Ú
__classcell__)r s @r r r s‘ ø€ € € € € Ø8Ð8ð8ð 8ð 8ð 8ð 8ð 8ð�sð ˜tð ð ð ð ð7 ð 7¨4ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7r r Úastr c ób — t | j ¦ « }| | ¦ « |j S )a Returns a set of all variables in the AST that will be looked up from
the context at runtime. Because at compile time it's not known which
variables will be used depending on the path the execution takes at
runtime, all variables are returned.
>>> from jinja2 import Environment, meta
>>> env = Environment()
>>> ast = env.parse('{% set foo = 42 %}{{ bar + foo }}')
>>> meta.find_undeclared_variables(ast) == {'bar'}
True
.. admonition:: Implementation
Internally the code generator is used for finding undeclared variables.
This is good to know because the code generator might raise a
:exc:`TemplateAssertionError` during compilation and as a matter of
fact this function can currently raise that exception as well.
)r r
Úvisitr )r+ Úcodegens r Úfind_undeclared_variablesr/ ! s. € õ&