-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClassScheduleStorage.py
More file actions
96 lines (68 loc) · 2.31 KB
/
Copy pathClassScheduleStorage.py
File metadata and controls
96 lines (68 loc) · 2.31 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
"""
Creates a data structure for class storage
Each class will have an ID, a name (optional)
A Mon start & end, a Tues start & end, a Wed start & end, a Thurs start & end, and a Fri start & end.
If
"""
class Schedule:
#data structures for classes
#class start times for each day of week
monStartTimes = dict()
tuesStartTimes = dict()
wedStartTimes = dict()
thursStartTimes = dict()
friStartTimes = dict()
#class end times for each day of week
monEndTimes = dict()
tuesEndTimes = dict()
wedEndTimes = dict()
thursEndTimes = dict()
friEndTimes = dict()
classes = list()
#function to fill in the data structures
#function to change times
# I would love to call this one "class", but that's a protected keyword.
# I'll be calling it "section", instead. This is intended to be for each class a student takes.
class Section:
classID = 0
classDays = list()
classStartTime = 0
classEndTime = 0
#returns a startTime time object and a endTime time object
# TODO: make it read in a start & end time for classes
# Assume for now that classes will always start and end at the same time, every day of the week
def getTimes(csvDict, classID):
start = ""
end = ""
classString = csvDict[classID]
return start, end
#TODO: make it read in days that a class occurs, assuming same days every week
"""
1: ['1', 'Stats', '10:20:00 AM', '', '10:20:00 AM', '', '10:20:00 AM', '', '', '11:15:00 AM', '', '11:15:00 AM', '', '11:15:00 AM']",
2: "['2', '', '', '09:35:00 AM', '', '09:35:00 AM', '', '', '', '', "
"'10:55:00 AM', '', '10:55:00 AM', '']"
Day of week with comma dictionary:
Start
Monday = 3rd item,
Tues = 4th item
Wed = 5
Thurs = 6
Fri = 7
End
Mon = 10
Tues = 11
Wed = 12
Thurs = 13
Fri = 14
"""
def getDays(csvDict, classID):
dayList = list()
classString = csvDict[classID]
return dayList
def __init__(self, csvDict, classID):
startTime, endTime = self.getTimes(csvDict, classID)
dayList = self.getDays(csvDict, classID)
self.classID = classID
self.classDays = dayList
self.classStartTime = startTime
self.classEndTime = endTime