-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor/ changed import to require to support browsers
- Loading branch information
1 parent
4ca59eb
commit fda749b
Showing
257 changed files
with
348 additions
and
775,647 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,7 +121,8 @@ dist | |
.idea/ | ||
|
||
# Automation to Build Json Data | ||
*.py | ||
automate.py | ||
minify.py | ||
**/*.zip | ||
backup | ||
**/*.min.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import json | ||
import os | ||
|
||
# Check if the countries and states are in sync | ||
countries_file = os.path.join(os.path.dirname(__file__), '../src/data/atlas.json') | ||
states_path = os.path.join(os.path.dirname(__file__), '../src/data/countries') | ||
|
||
with open(countries_file) as f: | ||
countries = json.load(f) | ||
|
||
for country in countries: | ||
country_name = country['iso2'] | ||
country_file = os.path.join(states_path, country_name.lower() + '.json') | ||
if not os.path.exists(country_file): | ||
raise Exception('Missing file: ' + country_file) | ||
print('All countries are in sync, count are : ' + str(len(countries))) | ||
|
||
# Check if the flags are in sync | ||
flags_path = os.path.join(os.path.dirname(__file__), '../flags/svg') | ||
flags = os.listdir(flags_path) | ||
for country in countries: | ||
country_name = country['iso2'].lower() + '.svg' | ||
if country_name not in flags: | ||
raise Exception('Missing flag: ' + country_name) | ||
print('All flags are in sync, count are : ' + str(len(flags))) | ||
exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,111 +1 @@ | ||
{ | ||
"code": "AD", | ||
"states": [ | ||
{ | ||
"name": "Andorra la Vella", | ||
"state_code": "07", | ||
"latitude": "42.50631740", | ||
"longitude": "1.52183550", | ||
"cities": [ | ||
{ | ||
"name": "Andorra la Vella", | ||
"latitude": "42.50779000", | ||
"longitude": "1.52109000" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "Canillo", | ||
"state_code": "02", | ||
"latitude": "42.59782490", | ||
"longitude": "1.65663770", | ||
"cities": [ | ||
{ | ||
"name": "Canillo", | ||
"latitude": "42.56760000", | ||
"longitude": "1.59756000" | ||
}, | ||
{ | ||
"name": "El Tarter", | ||
"latitude": "42.57952000", | ||
"longitude": "1.65362000" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "Encamp", | ||
"state_code": "03", | ||
"latitude": "42.53597640", | ||
"longitude": "1.58367730", | ||
"cities": [ | ||
{ | ||
"name": "Encamp", | ||
"latitude": "42.53474000", | ||
"longitude": "1.58014000" | ||
}, | ||
{ | ||
"name": "Pas de la Casa", | ||
"latitude": "42.54277000", | ||
"longitude": "1.73361000" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "Escaldes-Engordany", | ||
"state_code": "08", | ||
"latitude": "42.49093790", | ||
"longitude": "1.58869660", | ||
"cities": [ | ||
{ | ||
"name": "les Escaldes", | ||
"latitude": "42.50729000", | ||
"longitude": "1.53414000" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "La Massana", | ||
"state_code": "04", | ||
"latitude": "42.54562500", | ||
"longitude": "1.51473920", | ||
"cities": [ | ||
{ | ||
"name": "Arinsal", | ||
"latitude": "42.57205000", | ||
"longitude": "1.48453000" | ||
}, | ||
{ | ||
"name": "la Massana", | ||
"latitude": "42.54499000", | ||
"longitude": "1.51483000" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "Ordino", | ||
"state_code": "05", | ||
"latitude": "42.59944330", | ||
"longitude": "1.54023270", | ||
"cities": [ | ||
{ | ||
"name": "Ordino", | ||
"latitude": "42.55623000", | ||
"longitude": "1.53319000" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "Sant Julià de Lòria", | ||
"state_code": "06", | ||
"latitude": "42.45296310", | ||
"longitude": "1.49182350", | ||
"cities": [ | ||
{ | ||
"name": "Sant Julià de Lòria", | ||
"latitude": "42.46372000", | ||
"longitude": "1.49129000" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
{"code":"AD","states":[{"name":"Andorra la Vella","state_code":"07","latitude":"42.50631740","longitude":"1.52183550","cities":[{"name":"Andorra la Vella","latitude":"42.50779000","longitude":"1.52109000"}]},{"name":"Canillo","state_code":"02","latitude":"42.59782490","longitude":"1.65663770","cities":[{"name":"Canillo","latitude":"42.56760000","longitude":"1.59756000"},{"name":"El Tarter","latitude":"42.57952000","longitude":"1.65362000"}]},{"name":"Encamp","state_code":"03","latitude":"42.53597640","longitude":"1.58367730","cities":[{"name":"Encamp","latitude":"42.53474000","longitude":"1.58014000"},{"name":"Pas de la Casa","latitude":"42.54277000","longitude":"1.73361000"}]},{"name":"Escaldes-Engordany","state_code":"08","latitude":"42.49093790","longitude":"1.58869660","cities":[{"name":"les Escaldes","latitude":"42.50729000","longitude":"1.53414000"}]},{"name":"La Massana","state_code":"04","latitude":"42.54562500","longitude":"1.51473920","cities":[{"name":"Arinsal","latitude":"42.57205000","longitude":"1.48453000"},{"name":"la Massana","latitude":"42.54499000","longitude":"1.51483000"}]},{"name":"Ordino","state_code":"05","latitude":"42.59944330","longitude":"1.54023270","cities":[{"name":"Ordino","latitude":"42.55623000","longitude":"1.53319000"}]},{"name":"Sant Julià de Lòria","state_code":"06","latitude":"42.45296310","longitude":"1.49182350","cities":[{"name":"Sant Julià de Lòria","latitude":"42.46372000","longitude":"1.49129000"}]}]} |
Oops, something went wrong.