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.main
parent
74f7975e62
commit
1759c119a8
|
@ -344,12 +344,10 @@ def search():
|
||||||
# check for widgets and add if requested
|
# check for widgets and add if requested
|
||||||
if search_util.widget != '':
|
if search_util.widget != '':
|
||||||
html_soup = bsoup(str(response), 'html.parser')
|
html_soup = bsoup(str(response), 'html.parser')
|
||||||
match search_util.widget:
|
if search_util.widget == 'ip':
|
||||||
case 'ip':
|
response = add_ip_card(html_soup, get_client_ip(request))
|
||||||
response = add_ip_card(html_soup, get_client_ip(request))
|
elif search_util.widget == 'calculator' and not 'nojs' in request.args:
|
||||||
case 'calculator':
|
response = add_calculator_card(html_soup)
|
||||||
if not 'nojs' in request.args:
|
|
||||||
response = add_calculator_card(html_soup)
|
|
||||||
|
|
||||||
# Update tabs content
|
# Update tabs content
|
||||||
tabs = get_tabs_content(app.config['HEADER_TABS'],
|
tabs = get_tabs_content(app.config['HEADER_TABS'],
|
||||||
|
|
Loading…
Reference in New Issue