summaryrefslogtreecommitdiff
path: root/searx/botdetection
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2025-08-24 15:16:46 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2025-09-03 13:37:36 +0200
commitf24d85bc4be732b8edb2157ef4ecf35d380d2b45 (patch)
tree290dbfe99502776e358b9256eebc02004767f1f0 /searx/botdetection
parent57b9673efb1b4fd18a3ac15e26da642201e2cd33 (diff)
[mod] drop: from __future__ import annotations
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/botdetection')
-rw-r--r--searx/botdetection/__init__.py2
-rw-r--r--searx/botdetection/_helpers.py2
-rw-r--r--searx/botdetection/config.py2
-rw-r--r--searx/botdetection/http_accept.py2
-rw-r--r--searx/botdetection/http_accept_encoding.py2
-rw-r--r--searx/botdetection/http_accept_language.py2
-rw-r--r--searx/botdetection/http_connection.py2
-rw-r--r--searx/botdetection/http_sec_fetch.py2
-rw-r--r--searx/botdetection/http_user_agent.py2
-rw-r--r--searx/botdetection/ip_limit.py2
-rw-r--r--searx/botdetection/ip_lists.py2
-rw-r--r--searx/botdetection/link_token.py2
-rw-r--r--searx/botdetection/trusted_proxies.py2
-rw-r--r--searx/botdetection/valkeydb.py1
14 files changed, 13 insertions, 14 deletions
diff --git a/searx/botdetection/__init__.py b/searx/botdetection/__init__.py
index e686e3de9..5799b0f10 100644
--- a/searx/botdetection/__init__.py
+++ b/searx/botdetection/__init__.py
@@ -4,7 +4,7 @@
Implementations used for bot detection.
"""
-from __future__ import annotations
+
__all__ = ["init", "dump_request", "get_network", "too_many_requests", "ProxyFix"]
diff --git a/searx/botdetection/_helpers.py b/searx/botdetection/_helpers.py
index 19f5db36a..f0339384f 100644
--- a/searx/botdetection/_helpers.py
+++ b/searx/botdetection/_helpers.py
@@ -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"]
diff --git a/searx/botdetection/config.py b/searx/botdetection/config.py
index ad86f7884..d3ecc39eb 100644
--- a/searx/botdetection/config.py
+++ b/searx/botdetection/config.py
@@ -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
diff --git a/searx/botdetection/http_accept.py b/searx/botdetection/http_accept.py
index 4543e7217..1ae34d358 100644
--- a/searx/botdetection/http_accept.py
+++ b/searx/botdetection/http_accept.py
@@ -13,7 +13,7 @@ Accept_ header ..
"""
-from __future__ import annotations
+
from ipaddress import (
IPv4Network,
IPv6Network,
diff --git a/searx/botdetection/http_accept_encoding.py b/searx/botdetection/http_accept_encoding.py
index 3cc65ee17..918490ce5 100644
--- a/searx/botdetection/http_accept_encoding.py
+++ b/searx/botdetection/http_accept_encoding.py
@@ -14,7 +14,7 @@ bot if the Accept-Encoding_ header ..
"""
-from __future__ import annotations
+
from ipaddress import (
IPv4Network,
IPv6Network,
diff --git a/searx/botdetection/http_accept_language.py b/searx/botdetection/http_accept_language.py
index 6e7480728..626ed6b0e 100644
--- a/searx/botdetection/http_accept_language.py
+++ b/searx/botdetection/http_accept_language.py
@@ -11,7 +11,7 @@ if the Accept-Language_ header is unset.
"""
-from __future__ import annotations
+
from ipaddress import (
IPv4Network,
IPv6Network,
diff --git a/searx/botdetection/http_connection.py b/searx/botdetection/http_connection.py
index 6adcd4b39..0b7d9ae76 100644
--- a/searx/botdetection/http_connection.py
+++ b/searx/botdetection/http_connection.py
@@ -11,7 +11,7 @@ the Connection_ header is set to ``close``.
"""
-from __future__ import annotations
+
from ipaddress import (
IPv4Network,
IPv6Network,
diff --git a/searx/botdetection/http_sec_fetch.py b/searx/botdetection/http_sec_fetch.py
index edead3bfa..c1ea7333f 100644
--- a/searx/botdetection/http_sec_fetch.py
+++ b/searx/botdetection/http_sec_fetch.py
@@ -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,
diff --git a/searx/botdetection/http_user_agent.py b/searx/botdetection/http_user_agent.py
index 9b28660fe..76d2558ce 100644
--- a/searx/botdetection/http_user_agent.py
+++ b/searx/botdetection/http_user_agent.py
@@ -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,
diff --git a/searx/botdetection/ip_limit.py b/searx/botdetection/ip_limit.py
index 2b216baf7..b2559a97b 100644
--- a/searx/botdetection/ip_limit.py
+++ b/searx/botdetection/ip_limit.py
@@ -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,
diff --git a/searx/botdetection/ip_lists.py b/searx/botdetection/ip_lists.py
index 77628b577..19f0e3667 100644
--- a/searx/botdetection/ip_lists.py
+++ b/searx/botdetection/ip_lists.py
@@ -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,
diff --git a/searx/botdetection/link_token.py b/searx/botdetection/link_token.py
index 9e815e194..a74b2eaa4 100644
--- a/searx/botdetection/link_token.py
+++ b/searx/botdetection/link_token.py
@@ -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,
diff --git a/searx/botdetection/trusted_proxies.py b/searx/botdetection/trusted_proxies.py
index 39a60997b..4fb4c04ab 100644
--- a/searx/botdetection/trusted_proxies.py
+++ b/searx/botdetection/trusted_proxies.py
@@ -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
diff --git a/searx/botdetection/valkeydb.py b/searx/botdetection/valkeydb.py
index 3b8699786..44f265803 100644
--- a/searx/botdetection/valkeydb.py
+++ b/searx/botdetection/valkeydb.py
@@ -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