Merge pull request #1535 from mig5/censorship_update_countries_json

Update countries json files and script
This commit is contained in:
Micah Lee 2022-03-06 11:46:47 -08:00 committed by GitHub
commit 622d689b2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -22,9 +22,7 @@ def main():
available_locales = list(settings.available_locales)
# Make a dictionary that makes a language's ISO 3166-1 to its name in all enabled languages
os.makedirs(
os.path.join("src", "onionshare", "resources", "countries"), exist_ok=True
)
os.makedirs(os.path.join("onionshare", "resources", "countries"), exist_ok=True)
for locale in available_locales:
with open(os.path.join(repo_dir, "data", locale, "country.json")) as f:
countries = json.loads(f.read())
@ -34,9 +32,7 @@ def main():
del countries[key]
with open(
os.path.join(
"src", "onionshare", "resources", "countries", f"{locale}.json"
),
os.path.join("onionshare", "resources", "countries", f"{locale}.json"),
"w",
) as f:
f.write(json.dumps(countries))