hours: s/total_hours/goal_hours/
This commit is contained in:
parent
d507212a61
commit
f92dc5c5e6
8
hours
8
hours
@ -29,12 +29,12 @@ def get_dt_from_log_line(line):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def main(argv):
|
def main(argv):
|
||||||
total_hours = 40
|
goal_hours = 40
|
||||||
parser = argparse.ArgumentParser('hours')
|
parser = argparse.ArgumentParser('hours')
|
||||||
parser.add_argument('-t', '--total', type=float)
|
parser.add_argument('-t', '--total', type=float)
|
||||||
args = parser.parse_args(argv[1:])
|
args = parser.parse_args(argv[1:])
|
||||||
if args.total is not None:
|
if args.total is not None:
|
||||||
total_hours = args.total
|
goal_hours = args.total
|
||||||
|
|
||||||
times = []
|
times = []
|
||||||
for i in range(7):
|
for i in range(7):
|
||||||
@ -90,10 +90,10 @@ def main(argv):
|
|||||||
border()
|
border()
|
||||||
sys.stdout.write('Total: %.1f hours' % round(seconds / 60.0 / 60.0, 1))
|
sys.stdout.write('Total: %.1f hours' % round(seconds / 60.0 / 60.0, 1))
|
||||||
|
|
||||||
secs_in_total_hours = total_hours * 60 * 60
|
secs_in_total_hours = goal_hours * 60 * 60
|
||||||
if total_seconds < secs_in_total_hours:
|
if total_seconds < secs_in_total_hours:
|
||||||
out_time = now + timedelta(0, secs_in_total_hours - total_seconds)
|
out_time = now + timedelta(0, secs_in_total_hours - total_seconds)
|
||||||
sys.stdout.write('; %.1f at: %s %s' % (total_hours,
|
sys.stdout.write('; %.1f at: %s %s' % (goal_hours,
|
||||||
out_time.strftime('%a %d'), fmt_time_dt(out_time)))
|
out_time.strftime('%a %d'), fmt_time_dt(out_time)))
|
||||||
sys.stdout.write('\n')
|
sys.stdout.write('\n')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user