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   
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   
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   
40  components.registerAdapter(ChangeBox, Change, IBox) 
41