Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: third_party/buildbot_7_12/buildbot/status/web/changes.py

Issue 12207158: Bye bye buildbot 0.7.12. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1
2 from zope.interface import implements
3 from twisted.python import components
4 from twisted.web.error import NoResource
5
6 from buildbot.changes.changes import Change
7 from buildbot.status.web.base import HtmlResource, StaticHTML, IBox, Box
8
9 # /changes/NN
10 class ChangesResource(HtmlResource):
11
12 def body(self, req):
13 data = ""
14 data += "Change sources:\n"
15 sources = self.getStatus(req).getChangeSources()
16 if sources:
17 data += "<ol>\n"
18 for s in sources:
19 data += "<li>%s</li>\n" % s.describe()
20 data += "</ol>\n"
21 else:
22 data += "none (push only)\n"
23 return data
24
25 def getChild(self, path, req):
26 num = int(path)
27 c = self.getStatus(req).getChange(num)
28 if not c:
29 return NoResource("No change number '%d'" % num)
30 return StaticHTML(c.asHTML(), "Change #%d" % num)
31
32
33 class ChangeBox(components.Adapter):
34 implements(IBox)
35
36 def getBox(self, req):
37 url = req.childLink("../changes/%d" % self.original.number)
38 text = self.original.get_HTML_box(url)
39 return Box([text], class_="Change")
40 components.registerAdapter(ChangeBox, Change, IBox)
41
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698