From c3705d8579a8a712e07064265417f926a8a64676 Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 18 Feb 2003 01:48:39 +0000 Subject: [PATCH] allow get("issue.item") for getting templates git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1519 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/cgi/templating.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index 54bf622..894c5d6 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -42,7 +42,7 @@ class Templates: 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 @@ class Templates: # 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] -- 2.39.5