summaryrefslogtreecommitdiff
path: root/searx/search/processors/online.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2021-04-27 15:13:39 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2021-04-27 15:13:39 +0200
commit924f9afea37b6c545a03505a7ec291cf44654ca7 (patch)
treee6dde4db9f29e6ffad19827569abc89db79e4544 /searx/search/processors/online.py
parentb1557b544368b416c158c13f12946859abbe00e0 (diff)
[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/online.py')
-rw-r--r--searx/search/processors/online.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/searx/search/processors/online.py b/searx/search/processors/online.py
index 57422c007..93a9c6cbf 100644
--- a/searx/search/processors/online.py
+++ b/searx/search/processors/online.py
@@ -1,24 +1,29 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
+# lint: pylint
+
+"""Processores for engine-type: ``online``
+
+"""
from time import time
import asyncio
-
import httpx
import searx.network
from searx import logger
from searx.utils import gen_useragent
-from searx.exceptions import (SearxEngineAccessDeniedException, SearxEngineCaptchaException,
- SearxEngineTooManyRequestsException,)
+from searx.exceptions import (
+ SearxEngineAccessDeniedException,
+ SearxEngineCaptchaException,
+ SearxEngineTooManyRequestsException,
+)
from searx.metrics.error_recorder import count_error
-
-from searx.search.processors.abstract import EngineProcessor
-
+from .abstract import EngineProcessor
logger = logger.getChild('searx.search.processor.online')
-
def default_request_params():
+ """Default request parameters for ``online`` engines."""
return {
'method': 'GET',
'headers': {},
@@ -31,6 +36,7 @@ def default_request_params():
class OnlineProcessor(EngineProcessor):
+ """Processor class for ``online`` engines."""
engine_type = 'online'
@@ -153,7 +159,7 @@ class OnlineProcessor(EngineProcessor):
except SearxEngineAccessDeniedException as e:
self.handle_exception(result_container, e, suspend=True)
logger.exception('engine {0} : Searx is blocked'.format(self.engine_name))
- except Exception as e:
+ except Exception as e: # pylint: disable=broad-except
self.handle_exception(result_container, e)
logger.exception('engine {0} : exception : {1}'.format(self.engine_name, e))