From 2ffd446e5c0be30717d9ff112d34ef606f08fcdd Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 24 Jul 2022 09:32:05 +0200 Subject: [mod] clarify the difference of the default category and subgrouping This PR does no functional change it is just an attempt to make more clear in the code, what a default category is and what a subcategory is. The previous name 'others' leads to confusion with the **category 'other'**. If a engine is not assigned to a category, the default is assigned:: DEFAULT_CATEGORY = 'other' If an engine has only one category and this category is shown as tab in the user interface, this engine has no further subgrouping:: NO_SUBGROUPING = 'without further subgrouping' Related: - https://github.com/searxng/searxng/issues/1604 - https://github.com/searxng/searxng/pull/1545 Signed-off-by: Markus Heiser --- searx/preferences.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'searx/preferences.py') diff --git a/searx/preferences.py b/searx/preferences.py index 5cee83a03..3da6d5d16 100644 --- a/searx/preferences.py +++ b/searx/preferences.py @@ -17,7 +17,7 @@ from searx.enginelib import Engine from searx.plugins import Plugin from searx.locales import LOCALE_NAMES from searx.webutils import VALID_LANGUAGE_CODE -from searx.engines import OTHER_CATEGORY +from searx.engines import DEFAULT_CATEGORY COOKIE_MAX_AGE = 60 * 60 * 24 * 365 * 5 # 5 years @@ -259,7 +259,7 @@ class EnginesSetting(BooleanChoices): choices = {} for engine in engines: for category in engine.categories: - if not category in list(settings['categories_as_tabs'].keys()) + [OTHER_CATEGORY]: + if not category in list(settings['categories_as_tabs'].keys()) + [DEFAULT_CATEGORY]: continue choices['{}__{}'.format(engine.name, category)] = not engine.disabled super().__init__(default_value, choices) -- cgit v1.2.3