Upload files to 'UI'
This commit is contained in:
parent
cced788f81
commit
7f22fb6bb6
1 changed files with 44 additions and 0 deletions
|
@ -134,4 +134,48 @@ def filter_arrows(win):
|
|||
tmp.append(i)
|
||||
win.story["arrows"] = tmp
|
||||
|
||||
def timestring(tleft):
|
||||
|
||||
# This crazy function will convert the microsecond into something a bit
|
||||
# more usefull. Like 03:20:90.06 Kind a thing.
|
||||
|
||||
tleftX = tleft
|
||||
|
||||
tleft = int(tleftX)
|
||||
|
||||
addend = tleftX - tleft
|
||||
|
||||
|
||||
valt = str(tleft)
|
||||
|
||||
if tleft > 60 :
|
||||
le = tleft
|
||||
tleft = int(tleft / 60)
|
||||
le = le - int(tleft * 60)
|
||||
|
||||
stleft = "0"*(2-len(str(tleft)))+str(tleft)
|
||||
sle = "0"*(2-len(str(le)))+str(le)
|
||||
|
||||
valt = stleft+":"+ sle
|
||||
|
||||
if tleft > 60 :
|
||||
lele = le
|
||||
le = tleft
|
||||
tleft = int(tleft / 60)
|
||||
le = le - int(tleft * 60)
|
||||
lele = (lele - le)
|
||||
if lele < 0:
|
||||
lele = int(lele * -1)
|
||||
|
||||
stleft = "0"*(2-len(str(tleft)))+str(tleft)
|
||||
sle = "0"*(2-len(str(le)))+str(le)
|
||||
slele = "0"*(2-len(str(lele)))+str(lele)
|
||||
|
||||
valt = stleft+":"+ sle + ":" + slele
|
||||
|
||||
if tleft > 24 :
|
||||
le = tleft
|
||||
tleft = int(tleft / 24)
|
||||
le = le - int(tleft * 24)
|
||||
valt = str(tleft)+" DAYS AND "+ str(le) + " HRS"
|
||||
return valt + "." + str(int(addend*100))
|
||||
|
|
Loading…
Reference in a new issue