mirror of
https://github.com/searxng/searxng.git
synced 2025-09-03 16:58:34 +02:00
[mod] drop: from __future__ import annotations
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
57b9673efb
commit
f24d85bc4b
67 changed files with 15 additions and 68 deletions
|
@ -38,7 +38,6 @@ area:
|
|||
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
__all__ = ["AnswererInfo", "Answerer", "AnswerStorage"]
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# pylint: disable=too-few-public-methods, missing-module-docstring
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import abc
|
||||
import importlib
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# pylint: disable=missing-module-docstring
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import random
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# pylint: disable=missing-module-docstring
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
from functools import reduce
|
||||
from operator import mul
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
Implementations used for bot detection.
|
||||
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
__all__ = ["init", "dump_request", "get_network", "too_many_requests", "ProxyFix"]
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# pylint: disable=missing-module-docstring, invalid-name
|
||||
from __future__ import annotations
|
||||
|
||||
import typing as t
|
||||
|
||||
__all__ = ["log_error_only_once", "dump_request", "get_network", "logger", "too_many_requests"]
|
||||
|
|
|
@ -6,7 +6,7 @@ The :py:class:`Config` class implements a configuration that is based on
|
|||
structured dictionaries. The configuration schema is defined in a dictionary
|
||||
structure and the configuration data is given in a dictionary structure.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import typing
|
||||
|
||||
import copy
|
||||
|
|
|
@ -13,7 +13,7 @@ Accept_ header ..
|
|||
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from ipaddress import (
|
||||
IPv4Network,
|
||||
IPv6Network,
|
||||
|
|
|
@ -14,7 +14,7 @@ bot if the Accept-Encoding_ header ..
|
|||
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from ipaddress import (
|
||||
IPv4Network,
|
||||
IPv6Network,
|
||||
|
|
|
@ -11,7 +11,7 @@ if the Accept-Language_ header is unset.
|
|||
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from ipaddress import (
|
||||
IPv4Network,
|
||||
IPv6Network,
|
||||
|
|
|
@ -11,7 +11,7 @@ the Connection_ header is set to ``close``.
|
|||
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from ipaddress import (
|
||||
IPv4Network,
|
||||
IPv6Network,
|
||||
|
|
|
@ -22,7 +22,7 @@ Metadata`_. A request is filtered out in case of:
|
|||
"""
|
||||
# pylint: disable=unused-argument
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from ipaddress import (
|
||||
IPv4Network,
|
||||
IPv6Network,
|
||||
|
|
|
@ -12,7 +12,7 @@ the User-Agent_ header is unset or matches the regular expression
|
|||
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
from ipaddress import (
|
||||
IPv4Network,
|
||||
|
|
|
@ -36,7 +36,7 @@ dropped.
|
|||
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For
|
||||
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from ipaddress import (
|
||||
IPv4Network,
|
||||
IPv6Network,
|
||||
|
|
|
@ -25,7 +25,7 @@ The ``ip_lists`` method implements :py:obj:`block-list <block_ip>` and
|
|||
"""
|
||||
# pylint: disable=unused-argument
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Tuple
|
||||
from ipaddress import (
|
||||
ip_network,
|
||||
|
|
|
@ -34,7 +34,7 @@ And in the HTML template from flask a stylesheet link is needed (the value of
|
|||
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For
|
||||
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from ipaddress import (
|
||||
IPv4Network,
|
||||
IPv6Network,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
(:py:obj:`flask.request.remote_addr`) behind a proxy chain."""
|
||||
# pylint: disable=too-many-branches
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import typing as t
|
||||
|
||||
from collections import abc
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""Providing a Valkey database for the botdetection methods."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import valkey
|
||||
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
----
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
__all__ = ["ExpireCacheCfg", "ExpireCacheStats", "ExpireCache", "ExpireCacheSQLite"]
|
||||
|
||||
import abc
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# pylint: disable=missing-module-docstring
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
import pathlib
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""Simple implementation to store currencies data in a SQL database."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
__all__ = ["CurrenciesDB"]
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""Simple implementation to store TrackerPatterns data in a SQL database."""
|
||||
|
||||
from __future__ import annotations
|
||||
import typing
|
||||
|
||||
__all__ = ["TrackerPatternsDB"]
|
||||
|
|
|
@ -9,7 +9,6 @@ To load traits from the persistence :py:obj:`EngineTraitsMap.from_data` can be
|
|||
used.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import json
|
||||
|
|
|
@ -10,7 +10,6 @@ intended monkey patching of the engine modules.
|
|||
engine modules aren't converted to an engine class, these builtin types will
|
||||
still be needed.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from searx.enginelib import traits as _traits
|
||||
|
|
|
@ -8,7 +8,6 @@ usage::
|
|||
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
import typing as t
|
||||
|
||||
import sys
|
||||
|
|
|
@ -35,7 +35,6 @@ Implementation
|
|||
==============
|
||||
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
from urllib.parse import urlencode
|
||||
|
|
|
@ -65,7 +65,6 @@ code lines are just relabeled (starting from 1) and appended (a disjoint set of
|
|||
code blocks in a single file might be returned from the API).
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import typing as t
|
||||
from urllib.parse import urlencode
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
.. _data URLs:
|
||||
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from urllib.parse import urlencode, urlparse, parse_qs
|
||||
from lxml import html
|
||||
|
|
|
@ -7,7 +7,6 @@ No public instance offer a public API now
|
|||
- https://github.com/searxng/searxng/issues/2722#issuecomment-2884993248
|
||||
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import time
|
||||
import random
|
||||
|
|
|
@ -26,7 +26,6 @@ Implementations
|
|||
===============
|
||||
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import typing as t
|
||||
from urllib.parse import urlencode, quote_plus
|
||||
|
|
|
@ -37,7 +37,6 @@ Implementations
|
|||
===============
|
||||
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#
|
||||
# Engine is documented in: docs/dev/engines/online/openalex.rst
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import typing as t
|
||||
from datetime import datetime
|
||||
|
|
|
@ -45,7 +45,6 @@ Implementations
|
|||
===============
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import time
|
||||
import random
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""SoundCloud is a German audio streaming service."""
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import datetime
|
||||
|
|
|
@ -74,7 +74,6 @@ Implementations
|
|||
===============
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from urllib.parse import urlencode
|
||||
from dateutil.parser import parse
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
Wolfram|Alpha (Science)
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from json import loads
|
||||
from urllib.parse import urlencode
|
||||
|
|
|
@ -51,7 +51,6 @@ Implementations
|
|||
"""
|
||||
# pylint: disable=fixme
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import random
|
||||
from json import loads
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
|
||||
"""
|
||||
# pylint: disable=invalid-name
|
||||
from __future__ import annotations
|
||||
|
||||
__all__ = ["SXNG_Request", "sxng_request", "SXNG_Response"]
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ an example in which the command line is called in the development environment::
|
|||
(py3) python -m searx.favicons --help
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
__all__ = ["init", "favicon_url", "favicon_proxy"]
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# pylint: disable=missing-module-docstring
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pathlib
|
||||
import msgspec
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""Implementations for a favicon proxy"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Callable
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ timeout``) and returns a tuple ``(data, mime)``.
|
|||
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
__all__ = ["DEFAULT_RESOLVER_MAP", "allesedv", "duckduckgo", "google", "yandex"]
|
||||
|
||||
|
|
|
@ -92,7 +92,6 @@ Implementation
|
|||
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
from ipaddress import ip_address
|
||||
import sys
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ SearXNG’s locale implementations
|
|||
================================
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import typing as t
|
||||
from pathlib import Path
|
||||
|
|
|
@ -94,7 +94,6 @@ Implementation
|
|||
:members:
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
__all__ = ["PluginInfo", "Plugin", "PluginStorage", "PluginCfg"]
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# pylint: disable=too-few-public-methods,missing-module-docstring
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
__all__ = ["PluginInfo", "Plugin", "PluginCfg", "PluginStorage"]
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""Calculate mathematical expressions using :py:obj:`ast.parse` (mode="eval")."""
|
||||
|
||||
from __future__ import annotations
|
||||
import typing
|
||||
|
||||
import ast
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# pylint: disable=missing-module-docstring, missing-class-docstring
|
||||
from __future__ import annotations
|
||||
import typing
|
||||
|
||||
import re
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# pylint: disable=missing-module-docstring
|
||||
from __future__ import annotations
|
||||
import typing
|
||||
|
||||
import re
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# pylint: disable=missing-module-docstring, missing-class-docstring
|
||||
from __future__ import annotations
|
||||
import typing
|
||||
|
||||
import re
|
||||
|
|
|
@ -4,7 +4,6 @@ user searches for ``tor-check``. It fetches the tor exit node list from
|
|||
:py:obj:`url_exit_list` and parses all the IPs into a list, then checks if the
|
||||
user's IP address is in it.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
from ipaddress import ip_address
|
||||
import typing
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ converters, each converter is one item in the list (compare
|
|||
of measurement are evaluated. The weighting in the evaluation results from the
|
||||
sorting of the :py:obj:`list of unit converters<symbol_to_si>`.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
import typing
|
||||
import re
|
||||
import babel.numbers
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""Searx preferences implementation.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
# pylint: disable=useless-object-inheritance
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# pylint: disable=invalid-name, missing-module-docstring, missing-class-docstring
|
||||
|
||||
from __future__ import annotations
|
||||
from abc import abstractmethod, ABC
|
||||
import re
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
"""
|
||||
# pylint: disable=too-few-public-methods
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
__all__ = [
|
||||
"Result",
|
||||
|
|
|
@ -28,7 +28,6 @@ template.
|
|||
"""
|
||||
# pylint: disable=too-few-public-methods
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
__all__ = ["AnswerSet", "Answer", "Translations", "WeatherAnswer"]
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ template.
|
|||
"""
|
||||
# pylint: disable=too-few-public-methods
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
__all__ = ["KeyValue"]
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ to be loaded. The rules used for this can be found in the
|
|||
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
import typing as t
|
||||
import os.path
|
||||
from collections.abc import MutableMapping
|
||||
|
|
|
@ -19,7 +19,6 @@ Examplarical implementations based on :py:obj:`SQLiteAppl`:
|
|||
|
||||
----
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import typing as t
|
||||
import abc
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""Utility functions for the engines"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import importlib
|
||||
|
|
|
@ -17,7 +17,6 @@ A valkey DB connect can be tested by::
|
|||
>>>
|
||||
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import pwd
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""Implementations used for weather conditions and forecast."""
|
||||
# pylint: disable=too-few-public-methods
|
||||
from __future__ import annotations
|
||||
|
||||
__all__ = [
|
||||
"symbol_url",
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""WebApp"""
|
||||
# pylint: disable=use-dict-literal
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# pylint: disable=missing-module-docstring, invalid-name
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import pathlib
|
||||
|
|
|
@ -5,7 +5,6 @@ Coordinates`_
|
|||
.. _SPARQL/WIKIDATA Precision, Units and Coordinates:
|
||||
https://en.wikibooks.org/wiki/SPARQL/WIKIDATA_Precision,_Units_and_Coordinates#Quantities
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
__all__ = ["convert_from_si", "convert_to_si", "symbol_to_si"]
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
- :py:obj:`searx.locales.LOCALE_NAMES`
|
||||
"""
|
||||
# pylint: disable=invalid-name
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Set
|
||||
import json
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
"""Test some code from module :py:obj:`searx.locales`"""
|
||||
|
||||
from __future__ import annotations
|
||||
from parameterized import parameterized
|
||||
from searx import locales
|
||||
from searx.sxng_locales import sxng_locales
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue