Skip to content

Commit

Permalink
[pylint] Pylint 2.10 - fix use-list-literal & use-dict-literal
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
return42 committed Aug 31, 2021
1 parent c6f7a73 commit b83c14c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion searx/engines/google_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
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 ....');
Expand Down
2 changes: 1 addition & 1 deletion searx/engines/google_videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")]'):
Expand Down
2 changes: 1 addition & 1 deletion searx/engines/meilisearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
base_url = 'http://localhost:7700'
index = ''
auth_key = ''
facet_filters = list()
facet_filters = []
_search_url = ''
result_template = 'key-value.html'
categories = ['general']
Expand Down
6 changes: 3 additions & 3 deletions searx/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def _post_init(self):
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)
Expand All @@ -296,7 +296,7 @@ def transform_form_items(self, items):

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('__')
Expand All @@ -311,7 +311,7 @@ def _post_init(self):
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)
Expand Down

0 comments on commit b83c14c

Please sign in to comment.