Skip to content

Commit

Permalink
[black] upgrade black 22.12.0 --> 24.2.0
Browse files Browse the repository at this point in the history
The issue discussed in [1] has been solved since [2] has been merged into black
/ now we can upgrade without touching 69 files as it was needed with black
23.1.0 [3].

[1] searxng#2159 (comment)
[2] psf/black#4060
[3] https://github.com/searxng/searxng/pull/2159/files

Signed-off-by: Markus Heiser <[email protected]>
  • Loading branch information
return42 committed Mar 9, 2024
1 parent 48d0487 commit a7b51f0
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mock==5.1.0
nose2[coverage_plugin]==0.14.1
cov-core==1.15.0
black==22.12.0
black==24.2.0
pylint==3.0.3
splinter==0.21.0
selenium==4.18.1
Expand Down
1 change: 0 additions & 1 deletion searx/botdetection/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ def value(name: str, data_dict: dict):
def validate(
schema_dict: typing.Dict, data_dict: typing.Dict, deprecated: typing.Dict[str, str]
) -> typing.Tuple[bool, list]:

"""Deep validation of dictionary in ``data_dict`` against dictionary in
``schema_dict``. Argument deprecated is a dictionary that maps deprecated
configuration names to a messages::
Expand Down
1 change: 1 addition & 0 deletions searx/engines/deezer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
search_url = url + 'search?{query}&index={offset}'
iframe_src = "https://www.deezer.com/plugins/player?type=tracks&id={audioid}"


# do search-request
def request(query, params):
offset = (params['pageno'] - 1) * 25
Expand Down
1 change: 1 addition & 0 deletions searx/engines/freesound.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
url + "search/text/?query={query}&page={page}&fields=name,url,download,created,description,type&token={api_key}"
)


# search request
def request(query, params):
params["url"] = search_url.format(
Expand Down
1 change: 1 addition & 0 deletions searx/engines/gentoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def get_lang_urls(language):
'zh': '简体中文',
}


# do search-request
def request(query, params):
# translate the locale (e.g. 'en-US') to language code ('en')
Expand Down
4 changes: 2 additions & 2 deletions searx/engines/pdbe.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ def construct_body(result):
year=result['release_year'],
)
img_src = pdbe_preview_url.format(pdb_id=result['pdb_id'])
except (KeyError):
except KeyError:
content = None
img_src = None

# construct url for preview image
try:
img_src = pdbe_preview_url.format(pdb_id=result['pdb_id'])
except (KeyError):
except KeyError:
img_src = None

return [title, content, img_src]
Expand Down
2 changes: 1 addition & 1 deletion searx/engines/sjp.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def response(resp):
for src in definitions:
infobox += f"<div><small>{src[0]}</small>"
infobox += "<ul>"
for (def_text, sub_def) in src[1]:
for def_text, sub_def in src[1]:
infobox += f"<li>{def_text}</li>"
if sub_def:
infobox += "<ol>"
Expand Down
1 change: 1 addition & 0 deletions searx/engines/spotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
url = 'https://api.spotify.com/'
search_url = url + 'v1/search?{query}&type=track&offset={offset}'


# do search-request
def request(query, params):
offset = (params['pageno'] - 1) * 20
Expand Down
1 change: 1 addition & 0 deletions searx/engines/yandex_music.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
url = 'https://music.yandex.ru'
search_url = url + '/handlers/music-search.jsx'


# do search-request
def request(query, params):
args = {'text': query, 'page': params['pageno'] - 1}
Expand Down
2 changes: 1 addition & 1 deletion searx/plugins/hostname_replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

def on_result(request, search, result):

for (pattern, replacement) in replacements.items():
for pattern, replacement in replacements.items():

if parsed in result:
if pattern.search(result[parsed].netloc):
Expand Down
1 change: 0 additions & 1 deletion searx/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@


class ValidationException(Exception):

"""Exption from ``cls.__init__`` when configuration value is invalid."""


Expand Down
1 change: 0 additions & 1 deletion searx/search/processors/online_currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def iso4217_to_name(iso4217, language):


class OnlineCurrencyProcessor(OnlineProcessor):

"""Processor class used by ``online_currency`` engines."""

engine_type = 'online_currency'
Expand Down
1 change: 0 additions & 1 deletion tests/unit/engines/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
'''


from searx.engines import command as command_engine
from tests import SearxTestCase

Expand Down
4 changes: 3 additions & 1 deletion tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ def test_detect_language(self):
l = utils.detect_language('The quick brown fox jumps over\nthe lazy dog')
self.assertEqual(l, 'en')

l = utils.detect_language('いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす')
l = utils.detect_language(
'いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす'
)
self.assertEqual(l, 'ja')

l = utils.detect_language('Pijamalı hasta yağız şoföre çabucak güvendi.')
Expand Down

0 comments on commit a7b51f0

Please sign in to comment.