diff options
author | Dalf <alex@al-f.net> | 2020-08-06 17:42:46 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2020-09-10 10:39:04 +0200 |
commit | 1022228d950c2a809ed613df1a515d9a6cafda7c (patch) | |
tree | d792dddea1a5b278b018ed4e024cd13340d5c1b1 /searx/engines/wolframalpha_api.py | |
parent | 272158944bf13503e2597018fc60a00baddec660 (diff) | |
download | searxng-1022228d950c2a809ed613df1a515d9a6cafda7c.tar.gz searxng-1022228d950c2a809ed613df1a515d9a6cafda7c.zip |
Drop Python 2 (1/n): remove unicode string and url_utils
Diffstat (limited to 'searx/engines/wolframalpha_api.py')
-rw-r--r-- | searx/engines/wolframalpha_api.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/searx/engines/wolframalpha_api.py b/searx/engines/wolframalpha_api.py index 1c58c4a9b..520eaa209 100644 --- a/searx/engines/wolframalpha_api.py +++ b/searx/engines/wolframalpha_api.py @@ -9,7 +9,7 @@ # @parse url, infobox from lxml import etree -from searx.url_utils import urlencode +from urllib.parse import urlencode # search-url search_url = 'https://api.wolframalpha.com/v2/query?appid={api_key}&{query}' @@ -45,15 +45,15 @@ def request(query, params): # replace private user area characters to make text legible def replace_pua_chars(text): - pua_chars = {u'\uf522': u'\u2192', # rigth arrow - u'\uf7b1': u'\u2115', # set of natural numbers - u'\uf7b4': u'\u211a', # set of rational numbers - u'\uf7b5': u'\u211d', # set of real numbers - u'\uf7bd': u'\u2124', # set of integer numbers - u'\uf74c': 'd', # differential - u'\uf74d': u'\u212f', # euler's number - u'\uf74e': 'i', # imaginary number - u'\uf7d9': '='} # equals sign + pua_chars = {'\uf522': '\u2192', # rigth arrow + '\uf7b1': '\u2115', # set of natural numbers + '\uf7b4': '\u211a', # set of rational numbers + '\uf7b5': '\u211d', # set of real numbers + '\uf7bd': '\u2124', # set of integer numbers + '\uf74c': 'd', # differential + '\uf74d': '\u212f', # euler's number + '\uf74e': 'i', # imaginary number + '\uf7d9': '='} # equals sign for k, v in pua_chars.items(): text = text.replace(k, v) |