diff options
Diffstat (limited to 'searxng_extra/docs_prebuild')
-rwxr-xr-x | searxng_extra/docs_prebuild | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/searxng_extra/docs_prebuild b/searxng_extra/docs_prebuild index f19d59800..9e4a18524 100755 --- a/searxng_extra/docs_prebuild +++ b/searxng_extra/docs_prebuild @@ -1,7 +1,5 @@ #!/usr/bin/env python -# lint: pylint # SPDX-License-Identifier: AGPL-3.0-or-later - """Script that implements some prebuild tasks needed by target docs.prebuild """ @@ -9,10 +7,10 @@ import sys import os.path import time from contextlib import contextmanager + from searx import settings, get_setting, locales from searx.infopage import InfoPageSet, InfoPage - _doc_user = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'docs', 'user')) @@ -27,13 +25,13 @@ def main(): with infopageset_ctx as infopageset: for _, _, page in infopageset.iter_pages('en'): fname = os.path.join(_doc_user, os.path.basename(page.fname)) - with open(fname, 'w') as f: + with open(fname, 'w', encoding='utf-8') as f: f.write(page.content) -class OfflinePage(InfoPage): +class OfflinePage(InfoPage): # pylint: disable=missing-class-docstring - def get_ctx(self): # pylint: disable=no-self-use + def get_ctx(self): """Jinja context to render :py:obj:`DocPage.content` for offline purpose (no links to SearXNG instance)""" @@ -55,7 +53,7 @@ def _instance_infosetset_ctx(base_url): # registered in the Flask app. settings['server']['secret_key'] = '' - from searx.webapp import app + from searx.webapp import app # pylint: disable=import-outside-toplevel # Specify base_url so that url_for() works for base_urls. If base_url is # specified, then these values from are given preference over any Flask's |