diff options
author | Martin Fischer <martin@push-f.com> | 2022-01-04 18:00:45 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2022-01-05 11:03:44 +0100 |
commit | a4c2cfb837a3f92e2c0f0b8a0bac7a6e03499640 (patch) | |
tree | c522af821c7584896998ebc74569e9a534fc5ef5 /searx/webutils.py | |
parent | b38036d519c8b74d7be972e7b730b50f92fa8db4 (diff) | |
download | searxng-a4c2cfb837a3f92e2c0f0b8a0bac7a6e03499640.tar.gz searxng-a4c2cfb837a3f92e2c0f0b8a0bac7a6e03499640.zip |
[enh] change categories_as_tabs from a list to a dict
The tab icon names are currently hard coded in the templates.
This commit lets us introduce an icon property in the future, e.g:
categories_as_tabs:
general:
icon: search-outline
Diffstat (limited to 'searx/webutils.py')
-rw-r--r-- | searx/webutils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/searx/webutils.py b/searx/webutils.py index 4c3073aac..0c0854dfc 100644 --- a/searx/webutils.py +++ b/searx/webutils.py @@ -146,7 +146,9 @@ def group_engines_in_tab(engines: Iterable[Engine]) -> List[Tuple[str, Iterable[ """Groups an Iterable of engines by their first non tab category""" def get_group(eng): - non_tab_categories = [c for c in eng.categories if c not in settings['categories_as_tabs'] + [OTHER_CATEGORY]] + non_tab_categories = [ + c for c in eng.categories if c not in list(settings['categories_as_tabs'].keys()) + [OTHER_CATEGORY] + ] return non_tab_categories[0] if len(non_tab_categories) > 0 else DEFAULT_GROUP_NAME groups = itertools.groupby(sorted(engines, key=get_group), get_group) |