/usr/local/lib/python3.6/site-packages/jinja2/__pycache__
NameSizeModeActions
async_utils.cpython-36.pyc24350644editdlrm
bccache.cpython-36.pyc130970644editdlrm
compiler.cpython-36.pyc543690644editdlrm
constants.cpython-36.pyc14960644editdlrm
debug.cpython-36.pyc53440644editdlrm
defaults.cpython-36.pyc12410644editdlrm
environment.cpython-36.pyc523970644editdlrm
exceptions.cpython-36.pyc54980644editdlrm
ext.cpython-36.pyc262740644editdlrm
filters.cpython-36.pyc497540644editdlrm
idtracking.cpython-36.pyc111250644editdlrm
lexer.cpython-36.pyc199830644editdlrm
loaders.cpython-36.pyc202170644editdlrm
meta.cpython-36.pyc37460644editdlrm
nativetypes.cpython-36.pyc48050644editdlrm
nodes.cpython-36.pyc411930644editdlrm
optimizer.cpython-36.pyc18610644editdlrm
parser.cpython-36.pyc276350644editdlrm
runtime.cpython-36.pyc328630644editdlrm
sandbox.cpython-36.pyc116960644editdlrm
tests.cpython-36.pyc64820644editdlrm
utils.cpython-36.pyc272170644editdlrm
visitor.cpython-36.pyc38390644editdlrm
_identifier.cpython-36.pyc18500644editdlrm
__init__.cpython-36.pyc18650644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/jinja2/__pycache__/visitor.cpython-36.pyc (3839B)
3 ^TBg @sZdZddlZddlmZejr8ddlZGdddejZ GdddZ Gd d d e Z dS) zVAPI for traversing the AST nodes. Implemented by the compiler and meta introspection. N)Nodec@s&eZdZeejejejdddZdS) VisitCallable)nodeargskwargsreturncOsdS)N)selfrrrr r 0/tmp/pip-build-0s3hx122/Jinja2/jinja2/visitor.py__call__ szVisitCallable.__call__N)__name__ __module__ __qualname__rtAnyr r r r r r src@sTeZdZdZeddddZeejejejdddZeejejejdd d Z d S) NodeVisitoraWalks 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. zt.Optional[VisitCallable])rrcCst|dt|jdS)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. Zvisit_N)getattrtyper )r rr r r get_visitorszNodeVisitor.get_visitor)rrrrcOs4|j|}|dk r"||f||S|j|f||S)z Visit a node.N)r generic_visit)r rrrfr r r visit#s zNodeVisitor.visitcOs(x"|jD]}|j|f||q WdS)z9Called if no explicit visitor function exists for a node.N)Ziter_child_nodesr)r rrrr r r r,szNodeVisitor.generic_visitN) r rr__doc__rrrrrrr r r r rs  rc@sFeZdZdZeejejedddZeejejejedddZ dS)NodeTransformeraWalks 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. )rrrrc Osx|jD]\}}t|trg}xT|D]L}t|trh|j|f||}|dkrRq&nt|tsh|j|q&|j|q&W||dd<q t|tr |j|f||}|dkrt||q t|||q W|S)N) iter_fields isinstancelistrrextendappenddelattrsetattr) r rrrfield old_valueZ new_valuesvalueZnew_noder r r r=s&       zNodeTransformer.generic_visitcOs&|j|f||}t|ts"|gS|S)z{As transformers may return lists in some places this method can be used to enforce a list as return value. )rrr)r rrrrvr r r visit_listSs zNodeTransformer.visit_listN) r rrrrrrrZListr&r r r r r2s r) rZtypingrZnodesrZ TYPE_CHECKINGZtyping_extensionsteZProtocolrrrr r r r s "