add accumulation of captured time
This commit is contained in:
6
main.py
6
main.py
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
from util.str_to_datetime import datetime
|
||||
from util.str_to_datetime import str_to_datetime as datetime
|
||||
|
||||
from model.TimeSlotContainer import time_slot_container as tsc
|
||||
from model.TimeSlot import TimeSlot
|
||||
@@ -35,3 +35,7 @@ if __name__ == "__main__":
|
||||
|
||||
elif args.command == "add":
|
||||
tsc.add_time_slot(args.name, datetime(args.start), datetime(args.end))
|
||||
|
||||
elif args.command == "acc":
|
||||
d = tsc.accumulate_duration(args.query)
|
||||
print(f"{d.seconds // 3600}:{d.seconds % 3600 // 60}")
|
||||
|
||||
Reference in New Issue
Block a user