-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteamregen.py
59 lines (51 loc) · 2.53 KB
/
teamregen.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
def make_element(q):
n,t,a,i=q
r = ' <div class=person onclick="show(this)"><img src="team/'+i+'">\n <div class=name>'+n+'</div>\n'
if t!='none':
r+=' <div class=team>'+t+'</div>\n'
return r+ ' <div class=about>'+a+'</div>\n </div>\n\n'
path = 'teamgen/'
with open(path+'header.txt') as f:html=f.read()
with open(path+'headermobile.txt') as f:htmlmob=f.read()
html += '\n <div class=pcontainer>Faculty and Mentors</div><!-- pcontainer is what I use for heading the different sections-->\n<!-- you need an empty pcontainer div every 5 people so that if their text was different lengths the pcontainer makes all 5 of the next people start at the same height.-->\n'
htmlmob += '\n <div class=pcontainer>Faculty and Mentors</div><!-- pcontainer is what I use for heading the different sections-->\n<!-- you need an empty pcontainer div every 5 people so that if their text was different lengths the pcontainer makes all 5 of the next people start at the same height.-->\n'
i = 0
with open(path+'mentors.txt') as f:
for s in f.read().split('\n\n'):
html += make_element(s.split('\n'))
htmlmob += make_element(s.split('\n'))
i+=1
if i%5 == 0:
html += '\n <div class=pcontainer></div>\n\n'
if i%2 == 0:
htmlmob += '\n <div class=pcontainer></div>\n\n'
html += '\n <div class=pcontainer>Current Members</div>\n'
htmlmob += '\n <div class=pcontainer>Current Members</div>\n'
i = 0
with open(path+'team.txt') as f:
for s in f.read().split('\n\n'):
html += make_element(s.split('\n'))
htmlmob += make_element(s.split('\n'))
i+=1
if i%5 == 0:
html += '\n <div class=pcontainer></div>\n\n'
if i%2 == 0:
htmlmob += '\n <div class=pcontainer></div>\n\n'
html += '\n <div class=pcontainer>Graduates</div>\n'
htmlmob += '\n <div class=pcontainer>Graduates</div>\n'
i = 0
with open(path+'grads.txt') as f:
for s in f.read().split('\n\n'):
html += make_element(s.split('\n'))
htmlmob += make_element(s.split('\n'))
i+=1
if i%5 == 0:
html += '\n <div class=pcontainer></div>\n\n'
if i%2 == 0:
htmlmob += '\n <div class=pcontainer></div>\n\n'
with open(path+'footer.txt') as f:
html += f.read()
with open(path+'footermobile.txt') as f:
htmlmob += f.read()
with open('team.html','w+') as f:f.write(html)
with open('team_mobile.html','w+') as f:f.write(htmlmob)