mirror of
https://github.com/searxng/searxng.git
synced 2025-12-22 19:50:00 +00:00
[pylint] Pylint 2.10 - fix use-list-literal & use-dict-literal
Pylint 2.10 added new default checks [1]:
use-list-literal
Emitted when list() is called with no arguments instead of using []
use-dict-literal
Emitted when dict() is called with no arguments instead of using {}
[1] https://pylint.pycqa.org/en/latest/whatsnew/2.10.html
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
@@ -285,7 +285,7 @@ class EnginesSetting(SwitchableSetting):
|
||||
transformed_choices = []
|
||||
for engine_name, engine in self.choices.items(): # pylint: disable=no-member,access-member-before-definition
|
||||
for category in engine.categories:
|
||||
transformed_choice = dict()
|
||||
transformed_choice = {}
|
||||
transformed_choice['default_on'] = not engine.disabled
|
||||
transformed_choice['id'] = '{}__{}'.format(engine_name, category)
|
||||
transformed_choices.append(transformed_choice)
|
||||
@@ -296,7 +296,7 @@ class EnginesSetting(SwitchableSetting):
|
||||
|
||||
def transform_values(self, values):
|
||||
if len(values) == 1 and next(iter(values)) == '':
|
||||
return list()
|
||||
return []
|
||||
transformed_values = []
|
||||
for value in values:
|
||||
engine, category = value.split('__')
|
||||
@@ -311,7 +311,7 @@ class PluginsSetting(SwitchableSetting):
|
||||
super()._post_init()
|
||||
transformed_choices = []
|
||||
for plugin in self.choices: # pylint: disable=access-member-before-definition
|
||||
transformed_choice = dict()
|
||||
transformed_choice = {}
|
||||
transformed_choice['default_on'] = plugin.default_on
|
||||
transformed_choice['id'] = plugin.id
|
||||
transformed_choices.append(transformed_choice)
|
||||
|
||||
Reference in New Issue
Block a user