diff options
| author | Martin Fischer <martin@push-f.com> | 2022-01-17 09:04:51 +0100 |
|---|---|---|
| committer | Martin Fischer <martin@push-f.com> | 2022-01-17 11:42:48 +0100 |
| commit | def62c3a47384b6672cb584cd586ea104b86754f (patch) | |
| tree | 3c250dbc0f50ddcd82ba336afd638c362bc9df21 /searx/search/processors/abstract.py | |
| parent | 6d43cf7952cb22dbf8c7d1851eeee1931f8604c3 (diff) | |
[typing] add type hints for dictionaries
Diffstat (limited to 'searx/search/processors/abstract.py')
| -rw-r--r-- | searx/search/processors/abstract.py | 5 |
1 files changed, 3 insertions, 2 deletions
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 |