File: //opt/alt/python37/lib/python3.7/site-packages/mako/ext/__pycache__/autohandler.cpython-37.pyc
B
�C]] � @ s2 d Z ddlZddlZddlZddd�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�autohandlerc C s� |j }| jj}|js:y|jt||f S tk
r8 Y nX t�dt �
|��|g }xft|�r�dd�|� }||kr�t
||�r�|js�|j�t||f|�S |S t|�dkr�P |g|dd �<