Mercurial > p > roundup > code
diff roundup/cgi/templating.py @ 1771:332fe2b77e1c
set the content type on page templates (can have XML templates now)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 28 Aug 2003 05:15:50 +0000 |
| parents | fdaa0b751355 |
| children | 5f15fb95180c |
line wrap: on
line diff
--- a/roundup/cgi/templating.py Thu Aug 28 05:09:08 2003 +0000 +++ b/roundup/cgi/templating.py Thu Aug 28 05:15:50 2003 +0000 @@ -1,4 +1,4 @@ -import sys, cgi, urllib, os, re, os.path, time, errno +import sys, cgi, urllib, os, re, os.path, time, errno, mimetypes from roundup import hyperdb, date, rcsv from roundup.i18n import _ @@ -116,7 +116,8 @@ # compile the template self.templates[src] = pt = RoundupPageTemplate() - pt.write(open(src).read()) + # use pt_edit so we can pass the content_type guess too + pt.pt_edit(open(src).read(), mimetypes.guess_type(filename)) pt.id = filename pt.mtime = time.time() return pt
