diff options
author | joe <joe@deimos.lc8n.com> | 2011-11-23 15:22:07 +0000 |
---|---|---|
committer | joe <joe@deimos.lc8n.com> | 2011-11-23 15:22:07 +0000 |
commit | bdf93ad8811f2571f5da47c97d20fb909158f676 (patch) | |
tree | 551e0b612e801a394c33c672559837dce629e81a | |
parent | 76fe61ceb5a8677b7d52729aa497ace4a4b6ab19 (diff) |
Fixed count output option, was failing to show days before
-rwxr-xr-x | perc | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -39,7 +39,10 @@ # 3.6: # - Added a 'count' output option to display a countdown of days until the finish # - wjoe ruined everything +# 3.61: +# - Fixed count output, was failing to count days before # + import copy import decimal import json @@ -410,13 +413,11 @@ class Output(object): def count(self, ratio, start, finish, delta): seconds = delta.seconds - days = int(math.floor(seconds/60/60/24)) - seconds = seconds - (days*60*60*24) + days = delta.days hours = int(math.floor(seconds/60/60)) seconds = seconds - (hours*60*60) minutes = int(math.floor(seconds/60)) seconds = int(seconds - (minutes*60)) - print 'Event in ' + str(days) + ' day(s), ' + str(hours) + ' hour(s), ' + str(minutes) + ' minute(s), ' + str(seconds) + ' second(s).' def output(self, type, ratio, start, finish, count): |