summaryrefslogtreecommitdiff
path: root/searx/engines/__init__.py
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-01-03 07:24:20 +0100
committerMartin Fischer <martin@push-f.com>2022-01-05 11:03:44 +0100
commit1e195f5b95d4c59105249d66f5d170d40139a461 (patch)
tree5cb2b7a37d4f3fc95f986c262e4e38c40821d4b9 /searx/engines/__init__.py
parent5d74bf382012c73c701e1a4969e0f420b099db9f (diff)
downloadsearxng-1e195f5b95d4c59105249d66f5d170d40139a461.tar.gz
searxng-1e195f5b95d4c59105249d66f5d170d40139a461.zip
[mod] move group_engines_in_tab to searx.webutils
Diffstat (limited to 'searx/engines/__init__.py')
-rw-r--r--searx/engines/__init__.py24
1 files changed, 0 insertions, 24 deletions
diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py
index 9472186bf..70f6281a6 100644
--- a/searx/engines/__init__.py
+++ b/searx/engines/__init__.py
@@ -13,7 +13,6 @@ usage::
import sys
import copy
-import itertools
from os.path import realpath, dirname
from babel.localedata import locale_identifiers
@@ -267,26 +266,3 @@ def load_engines(engine_list):
if engine:
register_engine(engine)
return engines
-
-
-DEFAULT_GROUP_NAME = 'others'
-
-
-def group_engines_in_tab(engines): # pylint: disable=redefined-outer-name
- def engine_sort_key(engine):
- return (engine.about.get('language', ''), engine.name)
-
- def group_sort_key(group):
- return (group[0] == DEFAULT_GROUP_NAME, group[0].lower())
-
- def get_group(eng):
- non_tab_engines = [c for c in eng.categories if c not in settings['categories_as_tabs'] + [OTHER_CATEGORY]]
- return non_tab_engines[0] if len(non_tab_engines) > 0 else DEFAULT_GROUP_NAME
-
- return [
- (groupname, sorted(engines, key=engine_sort_key))
- for groupname, engines in sorted(
- ((name, list(engines)) for name, engines in itertools.groupby(sorted(engines, key=get_group), get_group)),
- key=group_sort_key,
- )
- ]