Remove more pointless encoding.
authorJelmer Vernooij <jelmer@samba.org>
Wed, 17 Nov 2010 10:19:32 +0000 (11:19 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 17 Nov 2010 10:19:32 +0000 (11:19 +0100)
buildfarm/hostdb.py
buildfarm/web/__init__.py

index ed4e753d3c2c8f623c41c329d1f6e1829b9d2b1c..24186c24529bef2b5b23277a7c7261c902f9a1fe 100644 (file)
@@ -125,7 +125,7 @@ class HostDatabase(object):
         """Write out the web/"""
 
         for host in self.hosts():
-            yield "%s: %s\n" % (host.name.encode("utf-8"), host.platform.encode("utf-8"))
+            yield "%s: %s\n" % (host.name, host.platform.encode("utf-8"))
 
     def commit(self):
         pass
@@ -143,7 +143,7 @@ class PlainTextHostDatabase(HostDatabase):
         try:
             for l in f:
                 (host, platform) = l.split(":", 1)
-                ret[host.decode("utf-8")] = platform.strip().decode("utf-8")
+                ret[host] = platform.strip().decode("utf-8")
         finally:
             f.close()
         return cls(ret)
index 159085f53611512b4c731aecf1cad15ba2990b3c..7badf2d06bf9f688c3de628fdd87a6f5b892ca05 100755 (executable)
@@ -628,9 +628,9 @@ class ViewRecentBuildsPage(BuildFarmPage):
                     build.age,
                     host.platform.encode("utf-8"),
                     "<a href='%s?function=View+Host;host=%s;tree=%s;compiler=%s#%s'>%s</a>"
-                        % (myself, host.name.encode("utf-8"),
-                           tree, build.compiler.encode("utf-8"), host.name.encode("utf-8"),
-                           host.name.encode("utf-8")),
+                        % (myself, host.name,
+                           tree, build.compiler, host.name,
+                           host.name),
                     build.compiler, tree, status, build.status(),
                     revision_link(myself, revision, tree),
                     revision_time])
@@ -674,7 +674,7 @@ class ViewHostPage(BuildFarmPage):
     def _render_build_list_header(self, host):
         yield "<div class='host summary'>"
         yield "<a id='host' name='host'/>"
-        yield "<h3>%s - %s</h3>" % (host.encode("utf-8"), self.buildfarm.hostdb.host(host).platform.encode("utf-8"))
+        yield "<h3>%s - %s</h3>" % (host, self.buildfarm.hostdb.host(host).platform.encode("utf-8"))
         yield "<table class='real'>"
         yield "<thead><tr><th>Target</th><th>Build<br/>Revision</th><th>Build<br />Age</th><th>Status<br />config/build<br />install/test</th><th>Warnings</th></tr></thead>"
         yield "<tbody>"
@@ -734,7 +734,7 @@ class ViewHostPage(BuildFarmPage):
                         "Tree", "Compiler", "Build Age", "Status", "Warnings")
                 for build in builds:
                     yield "%-12s %-10s %-10s %-10s %-10s\n" % (
-                            build.tree.encode("utf-8"), build.compiler.encode("utf-8"),
+                            build.tree, build.compiler,
                             util.dhm_time(build.age),
                             str(build.status()), build.err_count())
                 yield "\n"
@@ -895,7 +895,7 @@ class BuildFarmApp(object):
         self.buildfarm = buildfarm
 
         # host.properties are unicode object and the framework expect string object
-        self.hosts = dict([(host.name.encode("utf-8"), host) for host in self.buildfarm.hostdb.hosts()])
+        self.hosts = dict([(host.name, host) for host in self.buildfarm.hostdb.hosts()])
 
     def main_menu(self):
         """main page"""