| OLD | NEW | 
|    1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. |    1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 
|    2 # Use of this source code is governed by a BSD-style license that can be |    2 # Use of this source code is governed by a BSD-style license that can be | 
|    3 # found in the LICENSE file. |    3 # found in the LICENSE file. | 
|    4  |    4  | 
|    5 """ Source file for buildbot.status module modifications. """ |    5 """ Source file for buildbot.status module modifications. """ | 
|    6  |    6  | 
|    7 import os |    7 import os | 
|    8 import re |    8 import re | 
|    9 import urllib |    9 import urllib | 
|   10  |   10  | 
 |   11 import buildbot | 
|   11 from buildbot import interfaces |   12 from buildbot import interfaces | 
|   12 from buildbot import util |   13 from buildbot import util | 
|   13 import buildbot.process as process |   14 import buildbot.process as process | 
|   14 import buildbot.status.web.base as base |   15 import buildbot.status.web.base as base | 
|   15 import buildbot.status.web.baseweb as baseweb |   16 import buildbot.status.web.baseweb as baseweb | 
|   16 import buildbot.status.web.console as console |   17 import buildbot.status.web.console as console | 
|   17 import buildbot.status.web.waterfall as waterfall |   18 import buildbot.status.web.waterfall as waterfall | 
|   18 import buildbot.status.web.changes as changes |   19 import buildbot.status.web.changes as changes | 
|   19 import buildbot.status.web.builder as builder |   20 import buildbot.status.web.builder as builder | 
|   20 from buildbot.status.web.base import make_row |   21  | 
 |   22 if buildbot.version == '0.7.12': | 
 |   23   from buildbot.status.web.base import make_row | 
 |   24 else: | 
 |   25   ROW_TEMPLATE = ''' | 
 |   26   <div class="row"> | 
 |   27     <span class="label">%(label)s</span> | 
 |   28     <span class="field">%(field)s</span> | 
 |   29   </div> | 
 |   30   ''' | 
 |   31   from twisted.web import html | 
 |   32   def make_row(label, field): | 
 |   33     """Imported from Buildbot 0.7.12.""" | 
 |   34     label = html.escape(label) | 
 |   35     return ROW_TEMPLATE % {"label": label, "field": field} | 
 |   36  | 
|   21 import buildbot.status.builder as statusbuilder |   37 import buildbot.status.builder as statusbuilder | 
|   22 import buildbot.sourcestamp as sourcestamp |   38 import buildbot.sourcestamp as sourcestamp | 
|   23  |   39  | 
|   24 from twisted.python import log |   40 from twisted.python import log | 
|   25 from twisted.python import components |   41 from twisted.python import components | 
|   26 from twisted.web.util import Redirect |   42 from twisted.web.util import Redirect | 
|   27 from twisted.web import html |   43 from twisted.web import html | 
|   28 from zope.interface import declarations |   44 from zope.interface import declarations | 
|   29  |   45  | 
|   30 from master.third_party import stats |   46 from master.third_party import stats | 
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  114       if self.revision: |  130       if self.revision: | 
|  115         try: |  131         try: | 
|  116           text += '<br>r%d' % int(self.revision) |  132           text += '<br>r%d' % int(self.revision) | 
|  117         except ValueError: |  133         except ValueError: | 
|  118           text += '<br>%s' % self.revision |  134           text += '<br>%s' % self.revision | 
|  119       return text |  135       return text | 
|  120     changes.Change.get_HTML_box = get_HTML_box |  136     changes.Change.get_HTML_box = get_HTML_box | 
|  121     changes.Change.get_HTML_box_hooked = True |  137     changes.Change.get_HTML_box_hooked = True | 
|  122  |  138  | 
|  123  |  139  | 
|  124 HookChangeHtmlBox() |  140 # In Buildbot 0.7.12, hook get_HTML_box to add the revision number to the change | 
 |  141 # revision to the waterfall.  In 0.8.4p1, modify Buildbot directly to add the | 
 |  142 # change revision. | 
 |  143 if buildbot.version == '0.7.12': | 
 |  144   HookChangeHtmlBox() | 
|  125  |  145  | 
|  126  |  146  | 
|  127 def GetAnnounce(public_html): |  147 def GetAnnounce(public_html): | 
|  128   """Creates DIV that provides visuals on tree status. |  148   """Creates DIV that provides visuals on tree status. | 
|  129   """ |  149   """ | 
|  130   announce_path = os.path.join(public_html.path, 'announce.html') |  150   announce_path = os.path.join(public_html.path, 'announce.html') | 
|  131   return GetStaticFileContent(announce_path) |  151   return GetStaticFileContent(announce_path) | 
|  132  |  152  | 
|  133 def GetStaticFileContent(announce_path): |  153 def GetStaticFileContent(announce_path): | 
|  134   if os.path.exists(announce_path): |  154   if os.path.exists(announce_path): | 
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  454     self.putChild("waterfall", WaterfallStatusResource()) |  474     self.putChild("waterfall", WaterfallStatusResource()) | 
|  455     self.putChild("console", ConsoleStatusResource( |  475     self.putChild("console", ConsoleStatusResource( | 
|  456         orderByTime=self.orderConsoleByTime)) |  476         orderByTime=self.orderConsoleByTime)) | 
|  457     self.putChild("bot_status.json", console.ConsoleStatusResource()) |  477     self.putChild("bot_status.json", console.ConsoleStatusResource()) | 
|  458     self.putChild("stats", stats.StatsStatusResource()) |  478     self.putChild("stats", stats.StatsStatusResource()) | 
|  459     self.putChild("grid", ConsoleStatusResource()) |  479     self.putChild("grid", ConsoleStatusResource()) | 
|  460     self.putChild("tgrid", ConsoleStatusResource()) |  480     self.putChild("tgrid", ConsoleStatusResource()) | 
|  461     self.putChild("builders", BuildersResource()) |  481     self.putChild("builders", BuildersResource()) | 
|  462     self.putChild("horizontal_one_box_per_builder", |  482     self.putChild("horizontal_one_box_per_builder", | 
|  463                   HorizontalOneBoxPerBuilder()) |  483                   HorizontalOneBoxPerBuilder()) | 
| OLD | NEW |