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
14
15 name = request.args.get("builder", [None])[0]
16 number = request.args.get("number", [None])[0]
17 if not name or not number:
18 return "builder and number parameter missing"
19 number = int(number)
20
21
22 try:
23 builder = status.getBuilder(name)
24 except:
25 return "unknown builder"
26
27
28 build = builder.getBuild(int(number))
29 if not build:
30 return "unknown build %s" % number
31
32 rows = ctx['rows'] = []
33
34
35 for i in range(len(build.getSteps()) - 1, -1, -1):
36 step = build.getSteps()[i]
37 if step.isStarted() and step.getText():
38 rows.append(IBox(step).getBox(request).td(align="center"))
39
40
41 ctx['build'] = IBox(build).getBox(request).td(align="center")
42
43 template = request.site.buildbot_service.templates.get_template("buildstatus.html")
44 data = template.render(**ctx)
45
46
47
48
49 data = data.replace('<a ', '<a target="_blank"')
50 return data
51