diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2021-04-27 15:13:39 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2021-04-27 15:13:39 +0200 |
commit | 924f9afea37b6c545a03505a7ec291cf44654ca7 (patch) | |
tree | e6dde4db9f29e6ffad19827569abc89db79e4544 /searx/search/processors/abstract.py | |
parent | b1557b544368b416c158c13f12946859abbe00e0 (diff) | |
download | searxng-924f9afea37b6c545a03505a7ec291cf44654ca7.tar.gz searxng-924f9afea37b6c545a03505a7ec291cf44654ca7.zip |
[lint] pylint searx/search/processors files / BTW add some doc-strings
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/search/processors/abstract.py')
-rw-r--r-- | searx/search/processors/abstract.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/searx/search/processors/abstract.py b/searx/search/processors/abstract.py index 2a36222d4..38811d87c 100644 --- a/searx/search/processors/abstract.py +++ b/searx/search/processors/abstract.py @@ -1,4 +1,9 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint + +"""Abstract base classes for engine request processores. + +""" import threading from abc import abstractmethod, ABC @@ -10,12 +15,13 @@ from searx.network import get_time_for_thread, get_network from searx.metrics import histogram_observe, counter_inc, count_exception, count_error from searx.exceptions import SearxEngineAccessDeniedException - logger = logger.getChild('searx.search.processor') SUSPENDED_STATUS = {} +# pylint: disable=missing-function-docstring class SuspendedStatus: + """Class to handle suspend state.""" __slots__ = 'suspend_end_time', 'suspend_reason', 'continuous_errors', 'lock' @@ -49,6 +55,7 @@ class SuspendedStatus: class EngineProcessor(ABC): + """Base classes used for all types of reqest processores.""" __slots__ = 'engine', 'engine_name', 'lock', 'suspended_status' @@ -143,9 +150,7 @@ class EngineProcessor(ABC): if tests is None: tests = getattr(self.engine, 'additional_tests', {}) tests.update(self.get_default_tests()) - return tests - else: - return tests + return tests - def get_default_tests(self): + def get_default_tests(self): # pylint: disable=no-self-use return {} |