From: Mark Wooding Date: Sat, 16 Mar 2013 17:29:39 +0000 (+0000) Subject: cgi.py: Export the template cache to the templates. X-Git-Tag: 1.0.0~11 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/chopwood/commitdiff_plain/acd737d82202ac7874a03568b72f9b680244bfb9 cgi.py: Export the template cache to the templates. Now they can invoke each other with `~=TMPL[NAME]@?'. --- diff --git a/cgi.py b/cgi.py index 26295e0..b25d2d2 100644 --- a/cgi.py +++ b/cgi.py @@ -213,7 +213,7 @@ class TemplateFinder (object): with open(OS.path.join(me._dir, key)) as f: tmpl = f.read() me._cache[key] = tmpl return tmpl -TMPL = TemplateFinder(TMPLDIR) +STATE.kw['TMPL'] = TMPL = TemplateFinder(TMPLDIR) @CTX.contextmanager def tmplkw(**kw):