summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_html_live_status.py
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-09-11 15:39:34 +0200
committerHolger Levsen <holger@layer-acht.org>2015-09-11 15:39:34 +0200
commit5dfbba01b1150dd7e1ebd72610943cad4a63c7cf (patch)
tree0f5958b2f026887e8a07148e1271902bea7e2226 /bin/reproducible_html_live_status.py
parenta1d5955b84387a03501057bf66996ee6010bf4f7 (diff)
downloadjenkins.debian.net-5dfbba01b1150dd7e1ebd72610943cad4a63c7cf.tar.xz
reproducible: convert duration to human readable information
Diffstat (limited to 'bin/reproducible_html_live_status.py')
-rwxr-xr-xbin/reproducible_html_live_status.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/bin/reproducible_html_live_status.py b/bin/reproducible_html_live_status.py
index 426ff810..96d6eb2a 100755
--- a/bin/reproducible_html_live_status.py
+++ b/bin/reproducible_html_live_status.py
@@ -11,6 +11,22 @@
from reproducible_common import *
from reproducible_html_indexes import build_leading_text_section
+def convert_into_hms_string(duration):
+ if not duration:
+ duration = "None"
+ else:
+ hours = int(duration/3600)
+ minutes = int((duration-(hours*3600))/60)
+ seconds = int(duration-(hours*3600)-(minutes*60))
+ duration = ''
+ if hours > 0:
+ duration = str(hours)+'h ' + str(minutes)+'m ' + str(seconds) + 's'
+ elif minutes > 0:
+ duration = str(minutes)+'m ' + str(seconds) + 's'
+ else:
+ duration = str(seconds+"s")
+ return duration
+
def generate_schedule(arch):
""" the schedule pages are very different than others index pages """
log.info('Building the schedule index page for ' + arch + '...')
@@ -63,11 +79,12 @@ def generate_live_status_table(arch):
suite = row[1]
arch = row[2]
pkg = row[3]
+ duration = convert_into_hms_string(row[7])
html += tab + '<tr><td>&nbsp;</td><td>' + str(row[0]) + '</td>'
html += '<td>' + suite + '</td><td>' + arch + '</td>'
html += '<td><code>' + link_package(pkg, suite, arch) + '</code></td>'
html += '<td>' + str(row[4]) + '</td><td>' + str(row[5]) + '</td>'
- html += '<td>' + str(row[6]) + '</td><td>' + str(row[7]) + '</td> '
+ html += '<td>' + str(row[6]) + '</td><td>' + duration + '</td> '
html += '<td><a href="https://jenkins.debian.net/job/reproducible_builder_' + str(row[8]) + '/console">' + str(row[8]) + '</a></td>'
html += '</tr>\n'
html += '</table></p>\n'