1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 import urllib
18 from buildbot.status.web.base import HtmlResource, path_to_builder, \
19 path_to_build, css_classes
20 from buildbot.status.web.logs import LogsResource
21 from buildbot import util
22 from time import ctime
23
24
26 pageTitle = "Build Step"
27 addSlash = True
28
29 - def __init__(self, build_status, step_status):
33
34 - def content(self, req, cxt):
35 s = self.step_status
36 b = s.getBuild()
37
38 logs = cxt['logs'] = []
39 for l in s.getLogs():
40
41
42
43
44
45 logs.append({'has_contents': l.hasContents(),
46 'name': l.getName(),
47 'link': req.childLink("logs/%s" % urllib.quote(l.getName())) })
48
49 stepStatistics = s.getStatistics()
50 statistics = cxt['statistics'] = []
51 for stat in stepStatistics:
52 statistics.append({'name': stat, 'value': stepStatistics[stat]})
53
54 start, end = s.getTimes()
55
56 if start:
57 cxt['start'] = ctime(start)
58 if end:
59 cxt['end'] = ctime(end)
60 cxt['elapsed'] = util.formatInterval(end - start)
61 else:
62 cxt['end'] = "Not Finished"
63 cxt['elapsed'] = util.formatInterval(util.now() - start)
64
65 cxt.update(dict(builder_link = path_to_builder(req, b.getBuilder()),
66 build_link = path_to_build(req, b),
67 b = b,
68 s = s,
69 result_css = css_classes[s.getResults()[0]]))
70
71 template = req.site.buildbot_service.templates.get_template("buildstep.html");
72 return template.render(**cxt)
73
78
79
80
81
83 addSlash = True
84
88
89 - def content(self, req, ctx):
90 return "subpages show data for each step"
91
97