SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
Drop Python 2 (3/n): objects
Dalf78883777438f
diff --git a/searx/exceptions.py b/searx/exceptions.pyindex 0175acfa3..4af816272 100644--- a/searx/exceptions.py+++ b/searx/exceptions.py@@ -27,7 +27,7 @@ class SearxParameterException(SearxException):message = 'Empty ' + name + ' parameter'else:message = 'Invalid value "' + value + '" for parameter ' + name- super(SearxParameterException, self).__init__(message)+ super().__init__(message)self.message = messageself.parameter_name = nameself.parameter_value = valuediff --git a/searx/poolrequests.py b/searx/poolrequests.pyindex 9f0ee8736..51b6219c3 100644--- a/searx/poolrequests.py+++ b/searx/poolrequests.py@@ -20,7 +20,7 @@ class HTTPAdapterWithConnParams(requests.adapters.HTTPAdapter):self.config = {}self.proxy_manager = {}- super(requests.adapters.HTTPAdapter, self).__init__()+ super().__init__()self._pool_connections = pool_connectionsself._pool_maxsize = pool_maxsize@@ -60,7 +60,7 @@ else:class SessionSinglePool(requests.Session):def __init__(self):- super(SessionSinglePool, self).__init__()+ super().__init__()# reuse the same adapterswith RLock():@@ -71,7 +71,7 @@ class SessionSinglePool(requests.Session):def close(self):"""Call super, but clear adapters since there are managed globaly"""self.adapters.clear()- super(SessionSinglePool, self).close()+ super().close()def set_timeout_for_thread(timeout, start_time=None):diff --git a/searx/preferences.py b/searx/preferences.pyindex 04098be25..3042636a6 100644--- a/searx/preferences.py+++ b/searx/preferences.py@@ -32,7 +32,7 @@ class ValidationException(Exception):"""-class Setting(object):+class Setting:"""Base class of user settings"""def __init__(self, default_value, **kwargs):@@ -310,7 +310,7 @@ class PluginsSetting(SwitchableSetting):return [item[len('plugin_'):] for item in items]-class Preferences(object):+class Preferences:"""Validates and saves preferences to cookies"""def __init__(self, themes, categories, engines, plugins):diff --git a/searx/query.py b/searx/query.pyindex 69481f094..614e05c6b 100644--- a/searx/query.py+++ b/searx/query.py@@ -28,7 +28,7 @@ from searx.engines import (VALID_LANGUAGE_CODE = re.compile(r'^[a-z]{2,3}(-[a-zA-Z]{2})?$')-class RawTextQuery(object):+class RawTextQuery:"""parse raw text query (the value from the html input)"""def __init__(self, query, disabled_engines):@@ -178,7 +178,7 @@ class RawTextQuery(object):return ''.join(self.query_parts)-class SearchQuery(object):+class SearchQuery:"""container for all the search parameters (query, language, etc...)"""def __init__(self, query, engines, categories, lang, safesearch, pageno, time_range,diff --git a/searx/results.py b/searx/results.pyindex 51af32fd0..e4cad2e24 100644--- a/searx/results.py+++ b/searx/results.py@@ -122,14 +122,14 @@ def result_score(result):return sum((occurences * weight) / position for position in result['positions'])-class ResultContainer(object):+class ResultContainer:"""docstring for ResultContainer"""__slots__ = '_merged_results', 'infoboxes', 'suggestions', 'answers', 'corrections', '_number_of_results',\'_ordered', 'paging', 'unresponsive_engines', 'timings', 'redirect_url'def __init__(self):- super(ResultContainer, self).__init__()+ super().__init__()self._merged_results = []self.infoboxes = []self.suggestions = set()diff --git a/searx/search.py b/searx/search.pyindex 0af004603..3695128ab 100644--- a/searx/search.py+++ b/searx/search.py@@ -407,12 +407,12 @@ def get_search_query_from_webapp(preferences, form):raw_text_query)-class Search(object):+class Search:"""Search information container"""def __init__(self, search_query):# init vars- super(Search, self).__init__()+ super().__init__()self.search_query = search_queryself.result_container = ResultContainer()self.actual_timeout = None@@ -534,13 +534,13 @@ class SearchWithPlugins(Search):"""Similar to the Search class but call the plugins."""def __init__(self, search_query, ordered_plugin_list, request):- super(SearchWithPlugins, self).__init__(search_query)+ super().__init__(search_query)self.ordered_plugin_list = ordered_plugin_listself.request = requestdef search(self):if plugins.call(self.ordered_plugin_list, 'pre_search', self.request, self):- super(SearchWithPlugins, self).search()+ super().search()plugins.call(self.ordered_plugin_list, 'post_search', self.request, self)diff --git a/searx/webapp.py b/searx/webapp.pyindex ec2968259..25f43662a 100755--- a/searx/webapp.py+++ b/searx/webapp.py@@ -1040,7 +1040,7 @@ def run():)-class ReverseProxyPathFix(object):+class ReverseProxyPathFix:'''Wrap the application in this middleware and configure thefront-end server to add these headers, to let you quietly bindthis to a URL other than / and to an HTTP scheme that isdiff --git a/tests/unit/test_preferences.py b/tests/unit/test_preferences.pyindex 9117ddba0..32f50c60b 100644--- a/tests/unit/test_preferences.py+++ b/tests/unit/test_preferences.py@@ -3,7 +3,7 @@ from searx.preferences import (EnumStringSetting, MapSetting, MissingArgumentExcfrom searx.testing import SearxTestCase-class PluginStub(object):+class PluginStub:def __init__(self, id, default_on):self.id = id