summaryrefslogtreecommitdiff
path: root/searx/search.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2017-01-02 12:06:04 +0100
committerAlexandre Flament <alex@al-f.net>2017-01-02 12:06:04 +0100
commit84a2c97a653d216690da0000f47582118709d2d7 (patch)
treec735600400102ff5d96477aaaf1809dfd987be01 /searx/search.py
parent3d8c9bab9618b4d0cceadfac888af4560f7d3c9b (diff)
downloadsearxng-84a2c97a653d216690da0000f47582118709d2d7.tar.gz
searxng-84a2c97a653d216690da0000f47582118709d2d7.zip
[mod] searx uses flask framework only in webapp.py. Make migration to another framework easier.
Diffstat (limited to 'searx/search.py')
-rw-r--r--searx/search.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/searx/search.py b/searx/search.py
index e0f0cfd6a..0159d45b8 100644
--- a/searx/search.py
+++ b/searx/search.py
@@ -395,19 +395,20 @@ class SearchWithPlugins(Search):
"""Similar to the Search class but call the plugins."""
- def __init__(self, search_query, request):
+ def __init__(self, search_query, ordered_plugin_list, request):
super(SearchWithPlugins, self).__init__(search_query)
+ self.ordered_plugin_list = ordered_plugin_list
self.request = request
def search(self):
- if plugins.call('pre_search', self.request, self):
+ if plugins.call(self.ordered_plugin_list, 'pre_search', self.request, self):
super(SearchWithPlugins, self).search()
- plugins.call('post_search', self.request, self)
+ plugins.call(self.ordered_plugin_list, 'post_search', self.request, self)
results = self.result_container.get_ordered_results()
for result in results:
- plugins.call('on_result', self.request, self, result)
+ plugins.call(self.ordered_plugin_list, 'on_result', self.request, self, result)
return self.result_container