-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrefresh.py
executable file
·59 lines (49 loc) · 1.61 KB
/
refresh.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
#!/usr/bin/env python
"""Data-Munging for PyConCa 2013 Mobile Application Import."""
import os
import shutil
import sys
import components.schedule
import components.speakers
import components.sponsors
import util.spreadsheet
OUTPUT_DIR = os.path.join(os.getcwd(), "out")
def main():
"""Refresh all the data associated with the conference."""
shutil.rmtree(OUTPUT_DIR, ignore_errors=True)
os.makedirs(OUTPUT_DIR)
sponsor_levels = components.sponsors.get_sponsor_levels()
sponsors = components.sponsors.get_sponsors()
sponsors = components.sponsors.level_names_to_ids(sponsors, sponsor_levels)
speakers = components.speakers.get_speakers()
tracks = components.schedule.get_tracks()
schedule = components.schedule.get_schedule()
schedule = components.schedule.speaker_names_to_ids(schedule, speakers)
schedule = components.schedule.track_names_to_ids(schedule, tracks)
util.spreadsheet.write_spreadsheet(
speakers,
"speakers",
os.path.join(OUTPUT_DIR, "speakers.xls")
)
util.spreadsheet.write_spreadsheet(
tracks,
"tracks",
os.path.join(OUTPUT_DIR, "tracks.xls")
)
util.spreadsheet.write_spreadsheet(
schedule,
"schedule",
os.path.join(OUTPUT_DIR, "schedule.xls")
)
util.spreadsheet.write_spreadsheet(
sponsor_levels,
"sponsor_levels",
os.path.join(OUTPUT_DIR, "sponsor_levels.xls")
)
util.spreadsheet.write_spreadsheet(
sponsors,
"sponsors",
os.path.join(OUTPUT_DIR, "sponsors.xls")
)
if __name__ == "__main__":
sys.exit(main())