1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 18:06: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,8 +5301,11 @@ def print_jobhistory(apiurl, prj, current_package, repository, arch, format = 't
st = int(node.get('starttime')) st = int(node.get('starttime'))
et = int(node.get('endtime')) et = int(node.get('endtime'))
endtime = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(et)) endtime = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(et))
print "XXX", et, st
waittm = time.gmtime(et-st) waittm = time.gmtime(et-st)
if waittm.tm_hour: 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) waitbuild = " %2dh %2dm %2ds" % (waittm.tm_hour, waittm.tm_min, waittm.tm_sec)
else: else:
waitbuild = " %2dm %2ds" % (waittm.tm_min, waittm.tm_sec) waitbuild = " %2dm %2ds" % (waittm.tm_min, waittm.tm_sec)