-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.py
41 lines (32 loc) · 1.03 KB
/
map.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
33
34
35
36
37
38
39
40
41
import getlinks
import json
# Course Name : Alias
# Edit course_alias variable
course_alias = {'CGA Lab - III- S2': 'CGALAB',
'CGA - III - S2': 'CGA',
'OOAD - S2': 'OOAD',
'DMDW Lab - S2': 'DMDWLAB',
'DMDW - S2': 'DMDW',
'SE - S2': 'SE',
'III IT Seminar - S2':'SEMINAR',
'FE - MATLAB - S2': 'FE',
'III B Tech IT - PDC- S2': 'PDC'
}
def get_classes():
courses = getlinks.main()
if courses == {}:
return None
data = {}
for course in courses:
if course not in course_alias:
continue
data[course_alias[course]] = courses[course]
return data
def update_links():
data = get_classes()
if data is None:
pass
else:
with open( getlinks.pwd + 'data.json', 'w') as file:
file.write(json.dumps(data))
print('\n\t\t Links updated')