-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
37 lines (35 loc) · 1023 Bytes
/
main.py
File metadata and controls
37 lines (35 loc) · 1023 Bytes
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
33
34
35
36
37
from userInput import *
from schedulingJob import *
jobs = []
executionWindow = None
while True:
if jobs:
print(jobs)
if executionWindow is not None:
print(f"{str(executionWindow[0])}, {str(executionWindow[1])}")
value = userMainInput()
if value == 1:
job = userJobInput()
for j in jobs:
if j.id == job.id:
print("Id informado já existe.")
break
else:
jobs.append(userJobInput())
break
elif value == 2:
idToRemove = userRemoveInput()
for j in jobs:
if j.id == idToRemove:
jobs.remove(j)
print("Job removido com sucesso!.")
break
elif value == 3:
executionWindow = userExecutionWindowInput()
elif value == 4:
print(*getJobExecutionSet(jobs, executionWindow), sep='\n')
print('\n')
elif value == 5:
exit(0)
else:
print("Entre com um valor válido.")