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
Ben Busby 2023-03-01 09:42:30 -07:00
parent 74f7975e62
commit 1759c119a8
No known key found for this signature in database
GPG Key ID: B9B7231E01D924A1
1 changed files with 4 additions and 6 deletions

View File

@ -344,11 +344,9 @@ 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':
if search_util.widget == 'ip':
response = add_ip_card(html_soup, get_client_ip(request))
case 'calculator':
if not 'nojs' in request.args:
elif search_util.widget == 'calculator' and not 'nojs' in request.args:
response = add_calculator_card(html_soup)
# Update tabs content