diff options
Diffstat (limited to 'searx/search')
-rw-r--r-- | searx/search/processors/__init__.py | 3 | ||||
-rw-r--r-- | searx/search/processors/abstract.py | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/searx/search/processors/__init__.py b/searx/search/processors/__init__.py index 966b990ec..4e85527ba 100644 --- a/searx/search/processors/__init__.py +++ b/searx/search/processors/__init__.py @@ -15,6 +15,7 @@ __all__ = [ ] import threading +from typing import Dict from searx import logger from searx import engines @@ -26,7 +27,7 @@ from .online_currency import OnlineCurrencyProcessor from .abstract import EngineProcessor logger = logger.getChild('search.processors') -PROCESSORS = {} +PROCESSORS: Dict[str, EngineProcessor] = {} """Cache request processores, stored by *engine-name* (:py:func:`initialize`)""" diff --git a/searx/search/processors/abstract.py b/searx/search/processors/abstract.py index 732b55d52..b7703496b 100644 --- a/searx/search/processors/abstract.py +++ b/searx/search/processors/abstract.py @@ -8,6 +8,7 @@ import threading from abc import abstractmethod, ABC from timeit import default_timer +from typing import Dict, Union from searx import settings, logger from searx.engines import engines @@ -17,7 +18,7 @@ from searx.exceptions import SearxEngineAccessDeniedException, SearxEngineRespon from searx.utils import get_engine_from_settings logger = logger.getChild('searx.search.processor') -SUSPENDED_STATUS = {} +SUSPENDED_STATUS: Dict[Union[int, str], 'SuspendedStatus'] = {} class SuspendedStatus: @@ -61,7 +62,7 @@ class EngineProcessor(ABC): __slots__ = 'engine', 'engine_name', 'lock', 'suspended_status', 'logger' - def __init__(self, engine, engine_name): + def __init__(self, engine, engine_name: str): self.engine = engine self.engine_name = engine_name self.logger = engines[engine_name].logger |