Mercurial > p > roundup > code
diff roundup/cgi/templating.py @ 1441:2b20294b934a
allow get("issue.item") for getting templates
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 18 Feb 2003 01:48:39 +0000 |
| parents | b4c0819c7a57 |
| children | 6118d4498db3 |
line wrap: on
line diff
--- a/roundup/cgi/templating.py Mon Feb 17 22:32:43 2003 +0000 +++ b/roundup/cgi/templating.py Tue Feb 18 01:48:39 2003 +0000 @@ -42,7 +42,7 @@ else: self.getTemplate(filename, None) - def get(self, name, extension): + def get(self, name, extension=None): ''' Interface to get a template, possibly loading a compiled template. "name" and "extension" indicate the template we're after, which in @@ -55,12 +55,16 @@ # default the name to "home" if name is None: name = 'home' + elif extension is None and '.' in name: + # split name + name, extension = name.split('.') # find the source, figure the time it was last modified if extension: filename = '%s.%s'%(name, extension) else: filename = name + src = os.path.join(self.dir, filename) try: stime = os.stat(src)[os.path.stat.ST_MTIME]
