Ñò úõIc@sHdZddkZddkZddklZdefd„ƒYZdS(sq Default engine plugin for TGWidgets. Based on BuffetString which is Copyright (c) 2006 Christian Wyglendowski iÿÿÿÿN(tresource_filenametToscaWidgetsTemplatePlugincBs;eZdZddd„Zdd„Zdedd„ZRS(s.htmlcCs-||_|o ||_n tƒ|_dS(sextra_vars_func == optional callable() that returns a dict config == optional dict() of configuration settings N(tget_extra_varstconfigtdict(tselftextra_vars_funcR((s9/usr/lib/python2.6/site-packages/tw/core/engine_plugin.pyt__init__s  cCs˜|dj oti|ƒS|idƒ}|djo2|| }||d|i}t||ƒ}nt|ƒ}ti|iƒƒ}|iƒ|S(sî template_name == dotted.path.to.template (without .ext) template_string == string containing the template The dotted notation is present because many template engines allow templates to be compiled down to Python modules. TurboGears uses that feature to its adavantage, and for ease of integration the python.templating.engines plugin format requires the path to the template to be supplied as a dotted.path.to.template regardless of whether is is a module or not. In the case of string.Template templates, they are just simple text files, so we deal with the dotted notation and translate it into a standard file path to open the text file. t.iiN( tNonetstringtTemplatetrfindt extensionRtopentreadtclose(Rt template_namettemplate_stringtdividertpackagetbasenamet template_filet template_obj((s9/usr/lib/python2.6/site-packages/tw/core/engine_plugin.pyt load_templates     thtmlcCs4t|iƒo|i|iƒƒn|i|S(s info == dict() of variables to stick into the template namespace format == output format if applicable fragment == special rules about rendering part of a page template == compiled template as returned by `load_template` (tcallableRtupdatetsafe_substitute(Rtinfotformattfragmentttemplate((s9/usr/lib/python2.6/site-packages/tw/core/engine_plugin.pytrender9s N(t__name__t __module__R R RRtFalseR!(((s9/usr/lib/python2.6/site-packages/tw/core/engine_plugin.pyR s (t__doc__R tost pkg_resourcesRtobjectR(((s9/usr/lib/python2.6/site-packages/tw/core/engine_plugin.pyts