Mercurial > p > roundup > code
diff roundup/cgi/templating.py @ 1183:08a13a84ed43
Some speedups - both of the SQL backends can handle using only one cursor.
Better date unserialisation too.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 23 Sep 2002 06:48:35 +0000 |
| parents | cb35cf3db0e0 |
| children | 0a7bd082b94a |
line wrap: on
line diff
--- a/roundup/cgi/templating.py Mon Sep 23 01:01:06 2002 +0000 +++ b/roundup/cgi/templating.py Mon Sep 23 06:48:35 2002 +0000 @@ -63,6 +63,17 @@ class NoTemplate(Exception): pass +def precompileTemplates(dir): + ''' Go through a directory and precompile all the templates therein + ''' + for filename in os.listdir(dir): + if os.path.isdir(filename): continue + if '.' in filename: + name, extension = filename.split('.') + getTemplate(dir, name, extension) + else: + getTemplate(dir, filename, None) + def getTemplate(dir, name, extension, classname=None, request=None): ''' Interface to get a template, possibly loading a compiled template.
