mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 02:22:22 +02:00
[lint] pylint searx/search/processors files / BTW add some doc-strings
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
b1557b5443
commit
924f9afea3
6 changed files with 68 additions and 35 deletions
|
@ -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))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue