# HG changeset patch # User Jeff Hammel # Date 1343195500 25200 # Node ID 10945dedde84c3203c458066c8f968ab6bdecdff # Parent ff2f0788e91bd3cde997ce625eb14eca4a3e4f28 get query string working for TBPL suites diff -r ff2f0788e91b -r 10945dedde84 talosnames/templates/index.html --- a/talosnames/templates/index.html Tue Jul 24 22:29:37 2012 -0700 +++ b/talosnames/templates/index.html Tue Jul 24 22:51:40 2012 -0700 @@ -13,6 +13,7 @@ table, th, td { border: 1px solid black; } + dt { font-style: italic; font-weight: 550; diff -r ff2f0788e91b -r 10945dedde84 talosnames/web.py --- a/talosnames/web.py Tue Jul 24 22:29:37 2012 -0700 +++ b/talosnames/web.py Tue Jul 24 22:51:40 2012 -0700 @@ -30,8 +30,9 @@ tests[suite] = test except: tests[suite] = None + self.suites = suites - self.data = {'suites': suites, + self.data = {'suites': self.suites, 'commands': self.api.buildbot_commands, 'tbpl': dict([(suite, self.api.tbpl_name(suite)) for suite in suites]), @@ -86,13 +87,25 @@ def __call__(self, environ, start_response): request = Request(environ) response = Response(content_type='text/html', - body=self.render()) + body=self.render(request)) return response(environ, start_response) - def render(self): + def render(self, request=None): + data = self.data.copy() + if request and 'tbpl' in request.GET: + tbplnames = [] + for name in request.GET.getall('tbpl'): + if not name.startswith('Talos'): + name = 'Talos ' + name + tbplnames.append(name) + suites = [] + for suite, value in self.data['tbpl'].items(): + if value in tbplnames: + suites.append(suite) + data['suites'] = sorted(suites) contents = file(template).read() _template = tempita.HTMLTemplate(contents) - return _template.substitute(self.data) + return _template.substitute(data) if __name__ == '__main__':