1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-25 17:36:13 +01:00

- fix display of time in jobhistory when the job builds more than one day

This commit is contained in:
Adrian Schröter 2013-02-11 11:18:27 +01:00
parent 7d46c5f879
commit d21bbe48fd

View File

@ -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)