-
Notifications
You must be signed in to change notification settings - Fork 0
/
nltm.py
32 lines (30 loc) · 748 Bytes
/
nltm.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from task import Task
"""
Accept user commands on a loop
If what they type is not any predefined command, assume it is a task
Predefined commands are:
view [DATE]
history [from DATE]
quit
help
"""
taskStore = set()
if __name__ == '__main__':
while True:
cmd = input().lower()
if cmd == 'help':
print('OPTIONS: quit | history [from DATE] | view [DATE] | help | type any task')
elif cmd == 'quit':
quit()
else:
try:
first, *rest = cmd.split()
if first == 'view':
for task in taskStore:
print(task)
elif first == 'history':
print('Not yet implemented')
else:
taskStore |= {Task.processTask(cmd)}
except ValueError:
continue