
    +h]                     <    d dl mZ d dlmZ d dlmZ  G d d      Zy)    )compat)TemplateLookup)Templatec                   *    e Zd ZdZddZddZ	 ddZy)	TGPluginz&TurboGears compatible Template Plugin.Nc                 V   || _         || _        |si }i }|j                         D ])  \  }}|j                  d      r	|||dd  <    |dv s%|||<   + t	        di || _        i | _        t        j                  t        j                        d   D ]  }||v s||   | j                  |<    y )Nzmako.   )directoriesfilesystem_checksmodule_directoryr    )extra_vars_func	extensionitems
startswithr   lookuptmpl_optionsr   inspect_getargspecr   __init__)selfr   optionsr   lookup_optionskvkws           F/var/www/html/venv/lib/python3.12/site-packages/mako/ext/turbogears.pyr   zTGPlugin.__init__   s    ."G MMO 	&DAq||G$()qu%NN$%q!		&
 %6~6 ++H,=,=>qA 	;B^#(6r(:!!"%	;    c                     |t        |fi | j                  S d|vr%d|j                  dd      z   dz   | j                  z   }| j                  j                  |      S )z(Loads a template from a file or a string/.)r   r   replacer   r   get_template)r   templatenametemplate_strings      r   load_templatezTGPlugin.load_template&   se    &OAt/@/@AAl"l**344s:T^^K 
 {{''55r   c                     t        |t              r| j                  |      }| j                  r|j	                  | j                                 |j
                  di |S )Nr   )
isinstancestrr%   r   updaterender)r   infoformatfragmenttemplates        r   r*   zTGPlugin.render3   sR     h$))(3H KK,,./x&&&r   )NNmak)N)htmlFN)__name__
__module____qualname____doc__r   r%   r*   r   r   r   r   r      s    0;,6 =A
'r   r   N)makor   mako.lookupr   mako.templater   r   r   r   r   <module>r8      s     & "1' 1'r   