mirror of
https://github.com/benbusby/whoogle-search.git
synced 2025-07-09 03:04:13 -04:00
Replace Python 3.10 match
with if/else
Some distributions require manually installing Python 3.10, which makes it less convenient than just using whatever version of Python3.X the package manager supports. Since the only 3.10 feature being used was "match", and it was a very small change, it's been replaced with an if/else statement to ensure compatibility with older versions of Python 3.
This commit is contained in:
parent
74f7975e62
commit
1759c119a8
@ -344,12 +344,10 @@ def search():
|
||||
# check for widgets and add if requested
|
||||
if search_util.widget != '':
|
||||
html_soup = bsoup(str(response), 'html.parser')
|
||||
match search_util.widget:
|
||||
case 'ip':
|
||||
response = add_ip_card(html_soup, get_client_ip(request))
|
||||
case 'calculator':
|
||||
if not 'nojs' in request.args:
|
||||
response = add_calculator_card(html_soup)
|
||||
if search_util.widget == 'ip':
|
||||
response = add_ip_card(html_soup, get_client_ip(request))
|
||||
elif search_util.widget == 'calculator' and not 'nojs' in request.args:
|
||||
response = add_calculator_card(html_soup)
|
||||
|
||||
# Update tabs content
|
||||
tabs = get_tabs_content(app.config['HEADER_TABS'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user