summaryrefslogtreecommitdiff
path: root/searxng_extra/update
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-01-01 18:32:21 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2022-01-01 18:32:21 +0100
commit8191e1a25390a8e912bf02b4e34ebe524412643c (patch)
treebef06de19f07d1cb25a650bb90106b4e72f3af8f /searxng_extra/update
parent21d7c8b367f43b47eb5edd9dcda0075ee4029dba (diff)
downloadsearxng-8191e1a25390a8e912bf02b4e34ebe524412643c.tar.gz
searxng-8191e1a25390a8e912bf02b4e34ebe524412643c.zip
[fix] update_languages.py: generate code that passes CI
File searx/languages.py, created by update_languages.py has to pass quality check from CI:: make format.python Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searxng_extra/update')
-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()