summaryrefslogtreecommitdiff
path: root/searx/search/__init__.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2020-12-24 09:28:16 +0100
committerAlexandre Flament <alex@al-f.net>2021-01-12 11:47:17 +0100
commit8cbc9f2d5823eb984e99e15c963e306610007fa1 (patch)
tree4dea97c668d960926938aefc8f0f77456bee47d6 /searx/search/__init__.py
parentf7e11fd7222363a72a8fa33cf69190f64a3880bd (diff)
[enh] add checker
Diffstat (limited to 'searx/search/__init__.py')
-rw-r--r--searx/search/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/searx/search/__init__.py b/searx/search/__init__.py
index 0d45f0b7c..7768d21e9 100644
--- a/searx/search/__init__.py
+++ b/searx/search/__init__.py
@@ -64,6 +64,9 @@ class EngineRef:
def __eq__(self, other):
return self.name == other.name and self.category == other.category
+ def __hash__(self):
+ return hash((self.name, self.category))
+
class SearchQuery:
"""container for all the search parameters (query, language, etc...)"""
@@ -108,6 +111,10 @@ class SearchQuery:
and self.timeout_limit == other.timeout_limit\
and self.external_bang == other.external_bang
+ def __hash__(self):
+ return hash((self.query, tuple(self.engineref_list), self.lang, self.safesearch, self.pageno, self.time_range,
+ self.timeout_limit, self.external_bang))
+
class Search:
"""Search information container"""