From bdf93ad8811f2571f5da47c97d20fb909158f676 Mon Sep 17 00:00:00 2001 From: joe Date: Wed, 23 Nov 2011 15:22:07 +0000 Subject: Fixed count output option, was failing to show days before --- perc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/perc b/perc index 602625b..cb5b029 100755 --- a/perc +++ b/perc @@ -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): -- cgit v1.2.3