chiark
/
gitweb
/
~mdw
/
chopwood
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
77bef10
)
cgi.py: Export the template cache to the templates.
author
Mark Wooding
<mdw@distorted.org.uk>
Sat, 16 Mar 2013 17:29:39 +0000
(17:29 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sat, 16 Mar 2013 17:45:05 +0000
(17:45 +0000)
Now they can invoke each other with `~=TMPL[NAME]@?'.
cgi.py
patch
|
blob
|
blame
|
history
diff --git
a/cgi.py
b/cgi.py
index 26295e038ccc04dbfeb53e4f715d872706cd9501..b25d2d2db6283d1fb500c3043c406be911139318 100644
(file)
--- 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
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):
@CTX.contextmanager
def tmplkw(**kw):