1 from buildbot.status.web.base import HtmlResource, IBox
2
6
7 - def content(self, request, ctx):
8 """Display a build in the same format as the waterfall page.
9 The HTTP GET parameters are the builder name and the build
10 number."""
11
12 status = self.getStatus(request)
13 request.setHeader('Cache-Control', 'no-cache')
14
15
16 name = request.args.get("builder", [None])[0]
17 number = request.args.get("number", [None])[0]
18 if not name or not number:
19 return "builder and number parameter missing"
20 number = int(number)
21
22
23 try:
24 builder = status.getBuilder(name)
25 except:
26 return "unknown builder"
27
28
29 build = builder.getBuild(int(number))
30 if not build:
31 return "unknown build %s" % number
32
33 rows = ctx['rows'] = []
34
35
36 for i in range(len(build.getSteps()) - 1, -1, -1):
37 step = build.getSteps()[i]
38 if step.isStarted() and step.getText():
39 rows.append(IBox(step).getBox(request).td(align="center"))
40
41
42 ctx['build'] = IBox(build).getBox(request).td(align="center")
43
44 template = request.site.buildbot_service.templates.get_template("buildstatus.html")
45 data = template.render(**ctx)
46
47
48
49
50 data = data.replace('<a ', '<a target="_blank"')
51 return data
52