Allow viewing trees.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 4 Dec 2010 02:36:08 +0000 (03:36 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 4 Dec 2010 02:36:08 +0000 (03:36 +0100)
buildfarm/web/__init__.py

index b2ef29b197f9c5431779a8ea299509035ea7a1dc..d8ccf93e7211149d5a1024dbbe7ed77928e56f15 100755 (executable)
@@ -129,7 +129,7 @@ def build_link(myself, build):
 
 
 def host_uri(myself, host):
-    return "%s?function=View+Host;host=%s" % (myself, host)
+    return "%s/host/%s" % (myself, host)
 
 def host_link(myself, host):
     return "<a href='%s'>%s</a>" % (host_uri(myself, host), host)
@@ -957,9 +957,14 @@ class BuildFarmApp(object):
                 yield "".join(self.html_page(form, page.render(myself, tree, revision)))
             else:
                 fn = wsgiref.util.shift_path_info(environ)
-                if fn == "recent":
-                    page = ViewRecentBuildsPage(self.buildfarm)
-                    yield "".join(self.html_page(form, page.render(myself, wsgiref.util.shift_path_info(environ), get_param(form, 'sortby') or 'age')))
+                if fn == "tree":
+                    tree = wsgiref.util.shift_path_info(environ)
+                    subfn = wsgiref.util.shift_path_info(environ)
+                    if subfn in ("", None, "+recent"):
+                        page = ViewRecentBuildsPage(self.buildfarm)
+                        yield "".join(self.html_page(form, page.render(myself, tree, get_param(form, 'sortby') or 'age')))
+                    else:
+                        yield "Unknown subfn %s" % subfn
                 elif fn == "host":
                     page = ViewHostPage(self.buildfarm)
                     yield "".join(self.html_page(form, page.render_html(myself, wsgiref.util.shift_path_info(environ))))
@@ -975,9 +980,9 @@ class BuildFarmApp(object):
                             yield build.read_subunit().read()
                         except NoTestOutput:
                             yield "There was no test output"
-                    elif subfn == "":
+                    elif subfn in ("", None):
                         yield "".join(self.html_page(form, page.render(myself, build, False)))
-                elif fn == "":
+                elif fn in ("", None):
                     page = ViewSummaryPage(self.buildfarm)
                     yield "".join(self.html_page(form, page.render_html(myself)))
                 else: