diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2021-08-31 10:40:29 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2021-08-31 10:40:29 +0200 |
commit | b83c14cf6b2114686165c5aa568b34851b680970 (patch) | |
tree | 867cbdf77e418559e4decdd0266b15bd55d9b723 /searx | |
parent | c6f7a731d5ae34bcc2cb01ed1c6d037ab88e57c8 (diff) | |
download | searxng-b83c14cf6b2114686165c5aa568b34851b680970.tar.gz searxng-b83c14cf6b2114686165c5aa568b34851b680970.zip |
[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>
Diffstat (limited to 'searx')
-rw-r--r-- | searx/engines/google_images.py | 2 | ||||
-rw-r--r-- | searx/engines/google_videos.py | 2 | ||||
-rw-r--r-- | searx/engines/meilisearch.py | 2 | ||||
-rw-r--r-- | searx/preferences.py | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/searx/engines/google_images.py b/searx/engines/google_images.py index edfc3df9a..f4fbbaa42 100644 --- a/searx/engines/google_images.py +++ b/searx/engines/google_images.py @@ -66,7 +66,7 @@ filter_mapping = { def scrap_out_thumbs(dom): """Scrap out thumbnail data from <script> tags. """ - ret_val = dict() + ret_val = {} for script in eval_xpath(dom, '//script[contains(., "_setImgSrc(")]'): _script = script.text # _setImgSrc('0','data:image\/jpeg;base64,\/9j\/4AAQSkZJR ....'); diff --git a/searx/engines/google_videos.py b/searx/engines/google_videos.py index 3747e85a5..3990d5b32 100644 --- a/searx/engines/google_videos.py +++ b/searx/engines/google_videos.py @@ -80,7 +80,7 @@ def _re(regexpr): def scrap_out_thumbs(dom): """Scrap out thumbnail data from <script> tags. """ - ret_val = dict() + ret_val = {} thumb_name = 'vidthumb' for script in eval_xpath_list(dom, '//script[contains(., "_setImagesSrc")]'): diff --git a/searx/engines/meilisearch.py b/searx/engines/meilisearch.py index 86cd7512c..d0d304e2a 100644 --- a/searx/engines/meilisearch.py +++ b/searx/engines/meilisearch.py @@ -12,7 +12,7 @@ from json import loads, dumps base_url = 'http://localhost:7700' index = '' auth_key = '' -facet_filters = list() +facet_filters = [] _search_url = '' result_template = 'key-value.html' categories = ['general'] diff --git a/searx/preferences.py b/searx/preferences.py index 69832c052..c19a11f4b 100644 --- a/searx/preferences.py +++ b/searx/preferences.py @@ -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) |