Browse files

Add support for showing in-progress builds.

  • Loading branch information...
1 parent 7079024 commit e17bc4263e41cf972b1b38e13ae05746c53ad3b4 @cboos committed Apr 27, 2010
View
11 HudsonTrac/HudsonTracPlugin.py
@@ -61,6 +61,8 @@ class HudsonTracPlugin(Component):
Whether to display the build descriptions for each build
instead of the canned "Build finished successfully etc."
messages.""")
+ display_building = BoolOption('hudson', 'display_building', False,
+ 'Also show in-progress builds (pulsating green ball)')
def __init__(self):
api_url = unicode_quote(self.job_url, '/%:@')
@@ -184,21 +186,26 @@ def get_number(parent, child):
for entry in info.documentElement.getElementsByTagName("build"):
# ignore builds that are still running
if get_string(entry, 'building') == 'true':
- continue
+ if not self.display_building:
+ continue
+ else:
+ result = 'INPROGRESS'
+ else:
+ result = get_string(entry, 'result')
# create timeline entry
started = get_number(entry, 'timestamp')
completed = started + get_number(entry, 'duration')
started /= 1000
completed /= 1000
- result = get_string(entry, 'result')
message, kind = {
'SUCCESS': ('Build finished successfully',
('build-successful',
'build-successful-alt')[self.alt_succ]),
'UNSTABLE': ('Build unstable', 'build-unstable'),
'ABORTED': ('Build aborted', 'build-aborted'),
+ 'INPROGRESS': ('Build in progress', 'build-inprogress'),
}.get(result, ('Build failed', 'build-failed'))
if self.use_desc:
View
1 HudsonTrac/htdocs/hudsontrac.css
@@ -3,3 +3,4 @@ dt.build-successful-alt a { background-image: url(success-alt.gif) !important }
dt.build-failed a { background-image: url(failed.gif) !important }
dt.build-aborted a { background-image: url(aborted.gif) !important }
dt.build-unstable a { background-image: url(unstable.gif) !important }
+dt.build-inprogress a { background-image: url(inprogress.gif) !important }
View
BIN HudsonTrac/htdocs/inprogress.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e17bc42

Please sign in to comment.