From d21bbe48fd5209d931f1910f3ce0141dde4d017a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Mon, 11 Feb 2013 11:18:27 +0100 Subject: [PATCH] - fix display of time in jobhistory when the job builds more than one day --- osc/core.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osc/core.py b/osc/core.py index 112288f5..0ad0447b 100644 --- a/osc/core.py +++ b/osc/core.py @@ -5301,11 +5301,14 @@ def print_jobhistory(apiurl, prj, current_package, repository, arch, format = 't st = int(node.get('starttime')) et = int(node.get('endtime')) endtime = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(et)) + print "XXX", et, st waittm = time.gmtime(et-st) - if waittm.tm_hour: - waitbuild = "%2dh %2dm %2ds" % (waittm.tm_hour, waittm.tm_min, waittm.tm_sec) + if waittm.tm_mday>1: + waitbuild = "%1dd %2dh %2dm %2ds" % (waittm.tm_mday-1, waittm.tm_hour, waittm.tm_min, waittm.tm_sec) + elif waittm.tm_hour: + waitbuild = " %2dh %2dm %2ds" % (waittm.tm_hour, waittm.tm_min, waittm.tm_sec) else: - waitbuild = " %2dm %2ds" % (waittm.tm_min, waittm.tm_sec) + waitbuild = " %2dm %2ds" % (waittm.tm_min, waittm.tm_sec) if format == 'csv': print '%s|%s|%s|%s|%s|%s' % (endtime, package, reason, code, waitbuild, worker)