Support for task state, image_type and pretty summary report
This commit is contained in:
@@ -12,8 +12,23 @@ def dt_to_decimal(utc):
|
||||
|
||||
|
||||
def dt_from_decimal(dec):
|
||||
if dec == None:
|
||||
return "n/a"
|
||||
integer = int(dec)
|
||||
micro = (dec - decimal.Decimal(integer)) * decimal.Decimal(1000000)
|
||||
|
||||
daittyme = datetime.datetime.utcfromtimestamp(integer)
|
||||
return daittyme.replace(microsecond=micro)
|
||||
|
||||
|
||||
def sec_to_str(sec):
|
||||
sec = int(sec)
|
||||
if sec < 60:
|
||||
return "%ds" % sec
|
||||
minutes = sec / 60
|
||||
sec = sec % 60
|
||||
if minutes < 60:
|
||||
return "%d:%02ds" % (minutes, sec)
|
||||
hours = minutes / 60
|
||||
minutes = minutes % 60
|
||||
return "%02d:%02d:%02d" % (hours, minutes, sec)
|
||||
|
Reference in New Issue
Block a user