move lib to core, no more sys.path fucking @cybojenix
This commit is contained in:
parent
ef48b81924
commit
7dc1daa69f
14 changed files with 911 additions and 4 deletions
14
util/timeformat.py
Normal file
14
util/timeformat.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
def timeformat(seconds):
|
||||
days = seconds / 86400
|
||||
seconds -= 86400 * days
|
||||
hours = seconds / 3600
|
||||
seconds -= 3600 * hours
|
||||
minutes = seconds / 60
|
||||
seconds -= 60 * minutes
|
||||
if days != 0:
|
||||
return "%sd %sh %sm %ss" % (days, hours, minutes, seconds)
|
||||
elif hours == 0 and minutes != 0:
|
||||
return "%sm %ss" % (minutes, seconds)
|
||||
elif hours == 0 and minutes == 0:
|
||||
return "%ss" % seconds
|
||||
return "%sh %sm %ss" % (hours, minutes, seconds)
|
Reference in a new issue