Ñò ûãtHc @sìdZddklZlZlZddklZddklZddk l Z ddk l Z ddk lZlZdd d d gZd Zdefd „ƒYZd efd„ƒYZd efd„ƒYZd efd„ƒYZdS(sYBasic support for the template engine plugin API used by TurboGears and CherryPy/Buffet. iÿÿÿÿ(tETtHTMLtXML(tDocType(tTemplate(tTemplateLoader(tMarkupTemplate(t TextTemplatetNewTextTemplatetConfigurationErrortAbstractTemplateEnginePlugintMarkupTemplateEnginePlugintTextTemplateEnginePluginsrestructuredtext encBseZdZRS(s=Exception raised when invalid plugin options are encountered.(t__name__t __module__t__doc__(((s</usr/lib64/python2.6/site-packages/genshi/template/plugin.pyR scBs_eZdZdZdZddd„Zdd„Zded„Z dedd„Z d„Z RS(s!Implementation of the plugin API.c Csç||_|djo h}n||_|iddƒ|_|iddƒ}t|tƒo|iƒdj}ntd|idd ƒi d ƒƒ}| |_ yt |id d ƒƒ}Wn,t j o t d |id ƒƒ‚nX|iddƒ}|ot|ƒ ot dƒ‚n|iddƒ}|djot d|ƒ‚nyt|idtƒƒ}Wn,t j o t d|idƒƒ‚nXttd|ƒd|d|d|id|d|d|ƒ|_dS(Nsgenshi.default_encodingsutf-8sgenshi.auto_reloadt1tontyesttruesgenshi.search_pathtt:sgenshi.max_cache_sizeis&Invalid value for max_cache_size: "%s"sgenshi.loader_callbacks"loader callback must be a functionsgenshi.lookup_errorststricttlenientsUnknown lookup errors mode "%s"sgenshi.allow_execs!Invalid value for allow_exec "%s"t auto_reloadtmax_cache_sizet default_classtvariable_lookupt allow_exectcallback(RRRR(Rsstrict(tget_extra_varstNonetoptionstgettdefault_encodingt isinstancet basestringtlowertfiltertsplittuse_package_namingtintt ValueErrorR tcallabletbooltTrueRttemplate_classtloader( tselftextra_vars_funcR Rt search_pathRtloader_callbackt lookup_errorsR((s</usr/lib64/python2.6/site-packages/genshi/template/plugin.pyt__init__)sD    $   cCs—|dj o|i|ƒS|iob|idƒ}|djoBddkl}|| }||d|i}|||ƒ}q‡n|ii|ƒS(s_Find a template specified in python 'dot' notation, or load one from a string. t.iiÿÿÿÿ(tresource_filenameiN( RR.R(trfindt pkg_resourcesR7t extensionR/tload(R0t templatenamettemplate_stringtdividerR7tpackagetbasename((s</usr/lib64/python2.6/site-packages/genshi/template/plugin.pyt load_templateRs    cCsF|djo |i}nh|d6}|io|i|ds T'