add deserialization of TimeSlot

This commit is contained in:
2024-06-13 10:21:19 +02:00
parent b4e389c106
commit 0abf886d11
2 changed files with 25 additions and 7 deletions

21
main.py
View File

@@ -1,12 +1,19 @@
#!/usr/bin/python3
import argparse
parser = argparse.ArgumentParser(description='Time tracker')
parser.add_argument('command', type=str, help='Manage time slots.', choices=['start', 'stop', 'add', 'ps', 'ls'])
parser.add_argument('-b', '--begin', type=str, help="The start time of a time slot.")
parser.add_argument('-e', '--end', type=str, help="The end time of a time slot.")
args = parser.parse_args()
from lib.DataStore import DataStore
from lib.TimeSlot import TimeSlot
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Time tracker')
parser.add_argument('command', type=str, help='Manage time slots.', choices=['start', 'stop', 'add', 'ps', 'ls'])
parser.add_argument('-b', '--begin', type=str, help="The start time of a time slot.")
parser.add_argument('-e', '--end', type=str, help="The end time of a time slot.")
args = parser.parse_args()
ds = DataStore("data.json")
if args.command == "ls":
print(ds.get_all_time_slots())