summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2022-11-27 14:23:07 +0200
committerYuval Adam <_@yuv.al>2022-11-27 14:23:07 +0200
commit97739aa87068d07483e44ed0903da75e16d5ba6e (patch)
tree305f550e2f4844084f3acdc202e0bbb4c8a735c7
parentcd6f1129c398a29ab6a43d8706363a8f0210507c (diff)
Normalize unicode chars in render_link comparison
-rw-r--r--Pipfile1
-rw-r--r--Pipfile.lock18
-rw-r--r--build.py5
3 files changed, 17 insertions, 7 deletions
diff --git a/Pipfile b/Pipfile
index 7011a7b..e3e19db 100644
--- a/Pipfile
+++ b/Pipfile
@@ -8,6 +8,7 @@ pyyaml = "*"
jinja2 = "*"
requests = "*"
aiohttp = "*"
+unidecode = "*"
[dev-packages]
black = "*"
diff --git a/Pipfile.lock b/Pipfile.lock
index 21d64a0..74b26b0 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
- "sha256": "73de48d179941db1a8ee7c45d84050116ac6d6b5e1af691bb364c280c1e3b37c"
+ "sha256": "158b0365c5c6f87ebb312fb8a742ee3693d3057db74558ef75f3f163d47b67a2"
},
"pipfile-spec": 6,
"requires": {},
@@ -408,13 +408,21 @@
"index": "pypi",
"version": "==2.28.1"
},
+ "unidecode": {
+ "hashes": [
+ "sha256:547d7c479e4f377b430dd91ac1275d593308dce0fc464fb2ab7d41f82ec653be",
+ "sha256:fed09cf0be8cf415b391642c2a5addfc72194407caee4f98719e40ec2a72b830"
+ ],
+ "index": "pypi",
+ "version": "==1.3.6"
+ },
"urllib3": {
"hashes": [
- "sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e",
- "sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997"
+ "sha256:47cc05d99aaa09c9e72ed5809b60e7ba354e64b59c9c173ac3018642d8bb41fc",
+ "sha256:c083dd0dce68dbfbe1129d5271cb90f9447dea7d52097c6e0126120c521ddea8"
],
- "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4'",
- "version": "==1.26.12"
+ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'",
+ "version": "==1.26.13"
},
"yarl": {
"hashes": [
diff --git a/build.py b/build.py
index 60d987d..3fc2b53 100644
--- a/build.py
+++ b/build.py
@@ -4,6 +4,7 @@ from jinja2 import Environment, PackageLoader, select_autoescape
from os import listdir, mkdir
from pathlib import Path
from shutil import copyfile
+from unidecode import unidecode
ROOT_PATH = Path(__file__).parent
@@ -45,8 +46,8 @@ candidates = list(sorted(candidates, key=lambda x: x["domain"]))
def render_link(value, classes):
- name = value["name"].lower().split(" ")
- domain = value["domain"].replace(".", "")
+ name = unidecode(value["name"]).lower().split(" ")
+ domain = unidecode(value["domain"]).replace(".", "")
res = []
for part in name:
if part == domain: