[Treepkg-commits] r80 - trunk/treepkg

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jun 10 17:37:22 CEST 2008


Author: bh
Date: 2008-06-10 17:37:22 +0200 (Tue, 10 Jun 2008)
New Revision: 80

Modified:
   trunk/treepkg/web.py
Log:
Serve log files ending with .html as text/html


Modified: trunk/treepkg/web.py
===================================================================
--- trunk/treepkg/web.py	2008-06-10 09:51:50 UTC (rev 79)
+++ trunk/treepkg/web.py	2008-06-10 15:37:22 UTC (rev 80)
@@ -53,7 +53,11 @@
         if len(rest) == 3:
             filename = self.determine_log_filename(*rest)
         if filename is not None:
-            return cptools.serveFile(filename, contentType="text/plain")
+            if filename.endswith(".html"):
+                content_type = "text/html"
+            else:
+                content_type = "text/plain"
+            return cptools.serveFile(filename, contentType=content_type)
         else:
             raise cherrypy.HTTPError(status="404")
 



More information about the Treepkg-commits mailing list