
    YeIi]                     0    d Z ddlZddlZddlZddZd ZdS )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                 X   |j         }| j        j        }|j        s&	 |j        t
          ||f         S # t          $ r Y nw xY wt          j        dt          j
        |                    |gz   }t          |          rdd                    |          z   }||k    r<t          ||          r,|j        s#|j                            t
          ||f|          S |S t          |          dk    rn|g|dd <   t          |          |j        s#|j                            t
          ||fd           S d S )Nz([^/]+)/   )lookupmodule_template_urifilesystem_checks
_uri_cacher   KeyErrorrefindall	posixpathdirnamelenjoin_file_exists
setdefault)templatecontextnamer   r
   tokenspaths          Y/var/www/html/MCyber-Diagnostic/venv/lib/python3.11/site-packages/mako/ext/autohandler.pyr   r   !   sb   ^FO1M# 	$k=$%GHH 	 	 	D	 Z
I$5m$D$DEENF
f++ SXXf%%%=  \&$%?%? + (33 -6   v;;!frss f++  #  ++-.
 
 	
 ts   1 
>>c                     t          j        dd|          }| j        D ]*}t          j                            |dz   |z             r dS +dS )Nz^/ r   TF)r   subdirectoriesosr   exists)r   r   psubds       r   r   r   @   sX    6%T""D  7>>!c'D.)) 	44	 u    )r   )__doc__r    r   r   r   r    r$   r   <module>r'      s\    * 
			     				   >    r$   