Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/mako/ext/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/mako/ext/__pycache__/autohandler.cpython-38.pyc
U

O��g]�@s2dZddlZddlZddlZddd�Zdd�ZdS)a�adds autohandler functionality to Mako templates.

requires that the TemplateLookup class is used with templates.

usage::

    <%!
        from mako.ext.autohandler import autohandler
    %>
    <%inherit file="${autohandler(template, context)}"/>


or with custom autohandler filename::

    <%!
        from mako.ext.autohandler import autohandler
    %>
    <%inherit file="${autohandler(template, context, name='somefilename')}"/>

�N�autohandlercCs�|j}|jj}|js<z|jt||fWStk
r:YnXt�dt	�
|��|g}t|�r�dd�|�}||kr�t
||�r�|js�|j�t||f|�S|St|�dkr�q�|g|dd�<qT|js�|j�t||fd�SdSdS)Nz([^/]+)�/����)�lookup�module�
_template_uriZfilesystem_checksZ
_uri_cacher�KeyError�re�findall�	posixpath�dirname�len�join�_file_exists�
setdefault)�template�context�namerr�tokens�path�r�A/opt/cppython/lib/python3.8/site-packages/mako/ext/autohandler.pyr!s4��cCs8t�dd|�}|jD]}tj�|d|�rdSqdS)Nz^/�rTF)r
�sub�directories�osr�exists)rrZpsub�drrrr@s

r)r)�__doc__rrr
rrrrrr�<module>s



F1le Man4ger