mirror of
https://github.com/searxng/searxng.git
synced 2025-07-24 13:49:26 +02:00
Drop Python 2 (1/n): remove unicode string and url_utils
This commit is contained in:
parent
272158944b
commit
1022228d95
112 changed files with 388 additions and 535 deletions
|
@ -1,14 +1,11 @@
|
|||
import json
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
import unicodedata
|
||||
|
||||
from io import open
|
||||
from datetime import datetime
|
||||
|
||||
if sys.version_info[0] == 3:
|
||||
unicode = str
|
||||
|
||||
categories = []
|
||||
url = 'https://duckduckgo.com/js/spice/currency/1/{0}/{1}'
|
||||
|
@ -20,7 +17,7 @@ db = 1
|
|||
|
||||
|
||||
def normalize_name(name):
|
||||
name = name.decode('utf-8').lower().replace('-', ' ').rstrip('s')
|
||||
name = name.decode().lower().replace('-', ' ').rstrip('s')
|
||||
name = re.sub(' +', ' ', name)
|
||||
return unicodedata.normalize('NFKD', name).lower()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue