[Buildbot-commits] buildbot/buildbot/status html.py,1.91,1.92

Brian Warner warner at users.sourceforge.net
Mon Oct 2 00:13:34 UTC 2006


Update of /cvsroot/buildbot/buildbot/buildbot/status
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17183/buildbot/status

Modified Files:
	html.py 
Log Message:
[project @ html.py: improve unicode handling from zero to 'enough']

Original author: warner at lothar.com
Date: 2006-10-02 00:04:42

Index: html.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- html.py	25 Sep 2006 02:43:56 -0000	1.91
+++ html.py	2 Oct 2006 00:13:32 -0000	1.92
@@ -144,14 +144,18 @@
 class HtmlResource(Resource):
     css = None
     contentType = "text/html; charset=UTF-8"
+    title = "Dummy"
+
     def render(self, request):
         data = self.content(request)
+        if isinstance(data, unicode):
+            data = data.encode("utf-8")
         request.setHeader("content-type", self.contentType)
         if request.method == "HEAD":
             request.setHeader("content-length", len(data))
             return ''
         return data
-    title = "Dummy"
+
     def content(self, request):
         data = ('<!DOCTYPE html PUBLIC'
                 ' "-//W3C//DTD XHTML 1.0 Transitional//EN"\n'
@@ -172,6 +176,7 @@
         data += self.body(request)
         data += "</body></html>\n"
         return data
+
     def body(self, request):
         return "Dummy\n"
 





More information about the Commits mailing list