From 01c03135f69edc210ed48522e1a7bb788f28a469 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 28 Aug 2003 05:15:50 +0000 Subject: [PATCH] set the content type on page templates (can have XML templates now) git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1838 57a73879-2fb5-44c3-a270-3262357dd7e2 --- CHANGES.txt | 1 + roundup/cgi/templating.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 95c39cf..d5a0b9b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,6 +13,7 @@ Fixed: - applied CSV fix for python2.3 (sf bug 790363) - fixed form padding in LHS menu (sf bug 790502) - fixed upgrading docs for timezones (sf bug 790498) +- set the content type on page templates (can have XML templates now) 2003-08-08 0.6.0 diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index 7008d9e..55e0b7d 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -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 @@ class Templates: # 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 -- 2.30.2