[Buildbot-commits] buildbot/buildbot/status/web base.py,1.23,1.24
Brian Warner
warner at users.sourceforge.net
Thu May 22 22:11:59 UTC 2008
Update of /cvsroot/buildbot/buildbot/buildbot/status/web
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16591/buildbot/status/web
Modified Files:
base.py
Log Message:
[project @ #145:OneLineMixin.make_line.patch]
Patch from Aaron Maxwell <amax at snaplogic.org>. Refactor
OneLineMixin.make_line(), splitting in into two methods: one that
gathers all the data needed for a build (get_line_values), and one
that takes that data, and renders it into an HTML line (make_line).
Original author: dustin at v.igoro.us
Date: 2008-04-04 03:25:51+00:00
Index: base.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/base.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- base.py 23 Mar 2008 03:14:52 -0000 1.23
+++ base.py 22 May 2008 22:11:56 -0000 1.24
@@ -335,7 +335,10 @@
class OneLineMixin:
LINE_TIME_FORMAT = "%b %d %H:%M"
- def make_line(self, req, build, include_builder=True):
+ def get_line_values(self, req, build):
+ '''
+ Collect the data needed for each line display
+ '''
builder_name = build.getBuilder().getName()
results = build.getResults()
text = build.getText()
@@ -363,7 +366,13 @@
'time': time.strftime(self.LINE_TIME_FORMAT,
time.localtime(build.getTimes()[0])),
}
+ return values
+ def make_line(self, req, build, include_builder=True):
+ '''
+ Format and render a single line into HTML
+ '''
+ values = self.get_line_values(req, build)
fmt_pieces = ['<font size="-1">(%(time)s)</font>',
'rev=[%(rev)s]',
'<span class="%(class)s">%(results)s</span>',
More information about the Commits
mailing list