| Server IP : 146.190.157.162 / Your IP : 216.73.217.110 Web Server : Apache System : Linux ubuntu-s-2vcpu-4gb-amd-sfo3-01-KIT-DIGITAL 6.5.0-44-generic #44-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 7 15:10:09 UTC 2024 x86_64 User : businessweek ( 639) PHP Version : 8.2.10-2ubuntu2.2 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_signal,pcntl_signal_dispatch,pcntl_getpriority,pcntl_setpriority,dl,putenv,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python3/dist-packages/jinja2/__pycache__/ |
Upload File : |
�
V�fb�
� � � d Z ddlZddlmZ ej rddlZ G d� dej � � Z G d� d� � Z
G d � d
e
� � ZdS )zVAPI for traversing the AST nodes. Implemented by the compiler and
meta introspection.
� N� )�Nodec �D � e Zd Zdedej dej dej fd�ZdS )�
VisitCallable�node�args�kwargs�returnc � � d S �N� )�selfr r r s �0/usr/lib/python3/dist-packages/jinja2/visitor.py�__call__zVisitCallable.__call__ s � ��C� N)�__name__�
__module__�__qualname__r �t�Anyr r
r r r r sJ � � � � � � �� �a�e� �q�u� ��� � � � � � r r c � � e Zd ZdZdeddfd�Zdedej dej dej fd�Zdedej dej dej fd �Z d
S )�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 �N � t | dt |� � j � �d� � S )z�Return 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)�getattr�typer )r r s r �get_visitorzNodeVisitor.get_visitor s( � �
�t�;�d�4�j�j�&9�;�;�T�B�B�Br r r c �j � | � |� � }|� ||g|�R i |��S | j |g|�R i |��S )z
Visit a node.)r �
generic_visit)r r r r �fs r �visitzNodeVisitor.visit# s] � ����T�"�"���=��1�T�+�D�+�+�+�F�+�+�+�!�t�!�$�8��8�8�8��8�8�8r c �V � |� � � D ]} | j |g|�R i |�� �dS )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, sL � ��/�/�1�1� 4� 4�J��D�J�z�3�D�3�3�3�F�3�3�3�3� 4� 4r N)
r r r �__doc__r r r r r! r r
r r r r s� � � � � � � � �C�� C�)D� C� C� C� C�9�$� 9�q�u� 9��� 9�!�%� 9� 9� 9� 9�4�$� 4�q�u� 4��� 4�!�%� 4� 4� 4� 4� 4� 4r r c � � e Zd ZdZdedej dej defd�Zdedej dej dej e fd�Z dS ) �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 �� � |� � � D ]�\ }}t |t � � rxg }|D ]k}t |t � � r? | j |g|�R i |��}|��+t |t � � s|� |� � �V|� |� � �l||d d �<