U  üe]ã@s6ddlmZddlmZddlmZGdd„dƒZdS)é)Úcompat)ÚTemplateLookup)ÚTemplatec@s.eZdZdZd dd„Zd dd„Zdd d „ZdS)ÚTGPluginz&TurboGears compatible Template Plugin.NÚmakcCs˜||_||_|si}i}| ¡D]4\}}| d¡rD|||dd…<q |dkr |||<q tf|Ž|_i|_t t j ¡dD]}||krx|||j|<qxdS)Nzmako.é)Ú directoriesZfilesystem_checksZmodule_directoryr) Úextra_vars_funcÚ extensionÚitemsÚ startswithrÚlookupÚ tmpl_optionsrZinspect_getargspecrÚ__init__)Úselfr Úoptionsr Zlookup_optionsÚkÚvÚkw©rúA/opt/hc_python/lib/python3.8/site-packages/mako/ext/turbogears.pyrs   zTGPlugin.__init__cCsD|dk rt|f|jŽSd|kr8d| dd¡d|j}|j |¡S)z(Loads a template from a file or a stringNú/Ú.)rrÚreplacer r Z get_template)rZ templatenameZtemplate_stringrrrÚ load_template&s ÿzTGPlugin.load_templateÚhtmlFcCs4t|tƒr| |¡}|jr(| | ¡¡|jf|ŽS)N)Ú isinstanceÚstrrr ÚupdateÚrender)rÚinfoÚformatÚfragmentÚtemplaterrrr3s   zTGPlugin.render)NNr)N)rFN)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrrrrrr s  ÿrN)ÚmakorZ mako.lookuprZ mako.templaterrrrrrÚs