-
Notifications
You must be signed in to change notification settings - Fork 2
/
update
executable file
·36 lines (31 loc) · 1.26 KB
/
update
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
#!/usr/bin/python3
import os
import sys
SELF_DIR = os.path.dirname(os.path.realpath(__file__))
def check_for_common_repo():
if not os.path.exists("../common"):
print("Please clone the 'common' repo as a sibling of this one:")
print("cd .. && git clone [email protected]:globaldothealth/common.git")
return False
return True
def update():
generate_full_data.generate_data(
os.path.join(SELF_DIR, "d"),
os.path.join(SELF_DIR, "c"),
overwrite=True, quiet=False)
data_util.retrieve_generable_data(".", should_overwrite=True, quiet=False)
# Note sure why there are two lines merged together for a couple of locations
os.system("sed -i 's/GB32/GB\\n32/' location_info.data")
os.system("sed -i 's/PE32/PE\\n32/' location_info.data")
os.system("sed -i 's/PE18/PE\\n18/' location_info.data")
os.system("sed -i 's/US43/US\\n43/' location_info.data")
os.system("../common/tools/sanitize_location_info")
# Add any new daily file to version control.
os.system("git add d/*.json")
if __name__ == "__main__":
if check_for_common_repo():
sys.path.insert(0, "../common/tools")
from tools import data_util, generate_full_data
import geo_util
geo_util.clean()
update()