Update countries-update-list.py to correct path, and run it to generate new country json files for other locales

This commit is contained in:
Miguel Jacq 2022-02-25 15:07:19 +11:00
parent 2da1174408
commit 94ce2a3e5d
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))