diff options
| author | Markus Heiser <markus.heiser@darmarIT.de> | 2023-03-29 09:47:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-29 09:47:21 +0200 |
| commit | f950119ca87363aec81591dc4985f11371aa2b3e (patch) | |
| tree | ab893ff1f60d8c969ff0f5c2fad0cff49148aa3c /searx/webutils.py | |
| parent | 64fea2f9cb079bd0055c6a23360097d285204515 (diff) | |
| parent | 6f9e678346e5978a09ee453a62fa133cdc0ee0bd (diff) | |
Merge pull request #2269 from return42/locale-revision
Revision of the locale- and language- handling in SearXNG
Diffstat (limited to 'searx/webutils.py')
| -rw-r--r-- | searx/webutils.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/searx/webutils.py b/searx/webutils.py index 6c023ebc3..e62b0d695 100644 --- a/searx/webutils.py +++ b/searx/webutils.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- +from __future__ import annotations + import os import pathlib import csv @@ -8,7 +10,7 @@ import re import inspect import itertools from datetime import datetime, timedelta -from typing import Iterable, List, Tuple, Dict +from typing import Iterable, List, Tuple, Dict, TYPE_CHECKING from io import StringIO from codecs import getincrementalencoder @@ -16,7 +18,10 @@ from codecs import getincrementalencoder from flask_babel import gettext, format_date from searx import logger, settings -from searx.engines import Engine, OTHER_CATEGORY +from searx.engines import OTHER_CATEGORY + +if TYPE_CHECKING: + from searx.enginelib import Engine VALID_LANGUAGE_CODE = re.compile(r'^[a-z]{2,3}(-[a-zA-Z]{2})?$') |