summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsearxng_extra/update/update_languages.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/searxng_extra/update/update_languages.py b/searxng_extra/update/update_languages.py
index 3a172d5dc..f37345808 100755
--- a/searxng_extra/update/update_languages.py
+++ b/searxng_extra/update/update_languages.py
@@ -189,7 +189,7 @@ def write_languages_file(languages):
"# -*- coding: utf-8 -*-",
"# list of language codes",
"# this file is generated automatically by utils/fetch_languages.py",
- "language_codes =",
+ "language_codes = (\n",
)
language_codes = []
@@ -212,8 +212,11 @@ def write_languages_file(languages):
language_codes = tuple(language_codes)
with open(languages_file, 'w') as new_file:
- file_content = "{file_headers} \\\n{language_codes}".format(
- file_headers='\n'.join(file_headers), language_codes=pformat(language_codes, indent=4)
+ file_content = "{file_headers} {language_codes},\n)\n".format(
+ # fmt: off
+ file_headers = '\n'.join(file_headers),
+ language_codes = pformat(language_codes, indent=4)[1:-1]
+ # fmt: on
)
new_file.write(file_content)
new_file.close()