Skip to content

Commit

Permalink
Merge commit '2f44d5d3129070aa212feea0aca24636405f9478' into jinja
Browse files Browse the repository at this point in the history
Conflicts:
	buildbot/status/web/baseweb.py
  • Loading branch information
marcus-sonestedt committed Dec 13, 2009
2 parents e80ccd6 + 2f44d5d commit 56f7b89
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
4 changes: 2 additions & 2 deletions buildbot/status/web/base.py
Expand Up @@ -265,8 +265,8 @@ def content(self, request, context=None):
data += self.fillTemplate(s.header, request)
data += "<head>\n"
for he in s.head_elements:
data += " " + self.fillTemplate(he, request) + "\n"
data += self.head(request)
data += " " + self.fillTemplate(he, request) + "\n"
data += self.head(request)
data += "</head>\n\n"

data += '<body %s>\n' % " ".join(['%s="%s"' % (k,v)
Expand Down
19 changes: 18 additions & 1 deletion buildbot/status/web/baseweb.py
Expand Up @@ -72,14 +72,15 @@ def _sorter(a, b):


# /one_line_per_build
# accepts builder=, branch=, numbuilds=
# accepts builder=, branch=, numbuilds=, reload=
class OneLinePerBuild(HtmlResource, BuildLineMixin):
"""This shows one line per build, combining all builders together. Useful
query arguments:
numbuilds=: how many lines to display
builder=: show only builds for this builder. Multiple builder= arguments
can be used to see builds from any builder in the set.
reload=: reload the page after this many seconds
"""

title = "Recent Builds"
Expand All @@ -93,6 +94,22 @@ def getChild(self, path, req):
builder = status.getBuilder(path)
return OneLinePerBuildOneBuilder(builder, numbuilds=self.numbuilds)

def get_reload_time(self, request):
if "reload" in request.args:
try:
reload_time = int(request.args["reload"][0])
return max(reload_time, 15)
except ValueError:
pass
return None

def head(self, request):
head = ''
reload_time = self.get_reload_time(request)
if reload_time is not None:
head += ' <meta http-equiv="refresh" content="%d">\n' % reload_time
return head

def body(self, req):
status = self.getStatus(req)
control = self.getControl(req)
Expand Down

0 comments on commit 56f7b89

Please sign in to comment.