diff roundup/cgi/templating.py @ 1772:eee2a0f99aea maint-0.6

oops
author Richard Jones <richard@users.sourceforge.net>
date Thu, 28 Aug 2003 05:20:40 +0000
parents d81d215167fd
children ae5ed85b111a
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Thu Aug 28 05:09:53 2003 +0000
+++ b/roundup/cgi/templating.py	Thu Aug 28 05:20:40 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,9 @@
 
         # 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
+        content_type = mimetypes.guess_type(filename)[0] or 'text/html'
+        pt.pt_edit(open(src).read(), content_type)
         pt.id = filename
         pt.mtime = time.time()
         return pt

Roundup Issue Tracker: http://roundup-tracker.org/