summaryrefslogtreecommitdiff
path: root/searx/preferences.py
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-01-04 14:14:37 +0100
committerMartin Fischer <martin@push-f.com>2022-01-06 14:21:15 +0100
commit83f8a8fc6dc7658e062ddcbe779cba57dfaa1cb3 (patch)
tree3df8a6dae63355a6a31a03e5ebbbeb5818ddc4b1 /searx/preferences.py
parentbb06758a7b737befcb28b8fe202d2c6da767146d (diff)
downloadsearxng-83f8a8fc6dc7658e062ddcbe779cba57dfaa1cb3.tar.gz
searxng-83f8a8fc6dc7658e062ddcbe779cba57dfaa1cb3.zip
[refactor] remove pointless tuple
Diffstat (limited to 'searx/preferences.py')
-rw-r--r--searx/preferences.py20
1 files changed, 7 insertions, 13 deletions
diff --git a/searx/preferences.py b/searx/preferences.py
index bbcfc524e..ae158773a 100644
--- a/searx/preferences.py
+++ b/searx/preferences.py
@@ -22,8 +22,6 @@ from searx.engines import OTHER_CATEGORY
COOKIE_MAX_AGE = 60 * 60 * 24 * 365 * 5 # 5 years
-DISABLED = 0
-ENABLED = 1
DOI_RESOLVERS = list(settings['doi_resolvers'])
@@ -226,11 +224,11 @@ class SwitchableSetting(Setting):
# pylint: disable=no-self-use
return values
- def parse_cookie(self, data):
- if data[DISABLED] != '':
- self.disabled = set(data[DISABLED].split(','))
- if data[ENABLED] != '':
- self.enabled = set(data[ENABLED].split(','))
+ def parse_cookie(self, data_disabled: str, data_enabled: str):
+ if data_disabled != '':
+ self.disabled = set(data_disabled.split(','))
+ if data_enabled != '':
+ self.enabled = set(data_enabled.split(','))
def parse_form(self, items: List[str]):
if self.locked:
@@ -455,13 +453,9 @@ class Preferences:
continue
self.key_value_settings[user_setting_name].parse(user_setting)
elif user_setting_name == 'disabled_engines':
- self.engines.parse_cookie(
- (input_data.get('disabled_engines', ''), input_data.get('enabled_engines', ''))
- )
+ self.engines.parse_cookie(input_data.get('disabled_engines', ''), input_data.get('enabled_engines', ''))
elif user_setting_name == 'disabled_plugins':
- self.plugins.parse_cookie(
- (input_data.get('disabled_plugins', ''), input_data.get('enabled_plugins', ''))
- )
+ self.plugins.parse_cookie(input_data.get('disabled_plugins', ''), input_data.get('enabled_plugins', ''))
elif user_setting_name == 'tokens':
self.tokens.parse(user_setting)
elif not any(