-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcontroller.py
More file actions
41 lines (36 loc) · 1000 Bytes
/
controller.py
File metadata and controls
41 lines (36 loc) · 1000 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
38
39
40
41
import model
# given two times, determine whether or not the current time fits in that window
def now(sTime, eTime):
current = model.getTime().time()
if current >= sTime and current <= eTime:
return True
else:
return False
# given a schedule list, determine the current block and return its model
def current_block(schedule_list):
for i in schedule_list:
if i.isnow() == True:
return i
def next_block(schedule_list):
current = model.getTime().time()
for i in schedule_list:
if current <= i.sTime:
return i
def testsblock(block):
# try:
# block.isnow()
# except RuntimeError:
# return ""
# return block.formsTime()
if block == None:
return ""
return block.formsTime()
def testeblock(block):
# try:
# block.isnow()
# except RuntimeError:
# return ""
# return block.formeTime()
if block == None:
return ""
return block.formeTime()