mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 10:32:21 +02:00
[enh] implement a OnlineUrlSearchProcessor
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
b7f74fbe42
commit
e92d40c854
2 changed files with 51 additions and 1 deletions
|
@ -11,6 +11,7 @@ __all__ = [
|
|||
'OnlineProcessor',
|
||||
'OnlineDictionaryProcessor',
|
||||
'OnlineCurrencyProcessor',
|
||||
'OnlineUrlSearchProcessor',
|
||||
'PROCESSORS',
|
||||
]
|
||||
|
||||
|
@ -24,6 +25,7 @@ from .online import OnlineProcessor
|
|||
from .offline import OfflineProcessor
|
||||
from .online_dictionary import OnlineDictionaryProcessor
|
||||
from .online_currency import OnlineCurrencyProcessor
|
||||
from .online_url_search import OnlineUrlSearchProcessor
|
||||
from .abstract import EngineProcessor
|
||||
|
||||
logger = logger.getChild('search.processors')
|
||||
|
@ -33,7 +35,13 @@ PROCESSORS: Dict[str, EngineProcessor] = {}
|
|||
|
||||
def get_processor_class(engine_type):
|
||||
"""Return processor class according to the ``engine_type``"""
|
||||
for c in [OnlineProcessor, OfflineProcessor, OnlineDictionaryProcessor, OnlineCurrencyProcessor]:
|
||||
for c in [
|
||||
OnlineProcessor,
|
||||
OfflineProcessor,
|
||||
OnlineDictionaryProcessor,
|
||||
OnlineCurrencyProcessor,
|
||||
OnlineUrlSearchProcessor,
|
||||
]:
|
||||
if c.engine_type == engine_type:
|
||||
return c
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue