mirror of
https://github.com/searxng/searxng.git
synced 2025-07-24 13:49:26 +02:00
[mod] searx.search.EngineRef: remove from_bang parameter
from_bang is True when the user query contains a bang. In this case the category is also set to 'none'. from_bang only usage was in searx.webadapter.parse_specific : if from_bang is True, then the EngineRef category is ignored and force to 'none'. This commit also removes the searx.webadapter.parse_sepecific function.
This commit is contained in:
parent
995ba2f406
commit
eda8934f15
5 changed files with 12 additions and 24 deletions
|
@ -52,18 +52,17 @@ def initialize(settings_engines=None):
|
|||
|
||||
class EngineRef:
|
||||
|
||||
__slots__ = 'name', 'category', 'from_bang'
|
||||
__slots__ = 'name', 'category'
|
||||
|
||||
def __init__(self, name: str, category: str, from_bang: bool=False):
|
||||
def __init__(self, name: str, category: str):
|
||||
self.name = name
|
||||
self.category = category
|
||||
self.from_bang = from_bang
|
||||
|
||||
def __repr__(self):
|
||||
return "EngineRef({!r}, {!r}, {!r})".format(self.name, self.category, self.from_bang)
|
||||
return "EngineRef({!r}, {!r})".format(self.name, self.category)
|
||||
|
||||
def __eq__(self, other):
|
||||
return self.name == other.name and self.category == other.category and self.from_bang == other.from_bang
|
||||
return self.name == other.name and self.category == other.category
|
||||
|
||||
|
||||
class SearchQuery:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue