From 9b41cb5b704279c62e058aba10bc0e4d664ceb6d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 8 Apr 2020 15:54:52 +0200 Subject: fix paths --- cli/app/thesaurus/api.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'cli/app/thesaurus/api.py') diff --git a/cli/app/thesaurus/api.py b/cli/app/thesaurus/api.py index 89e5ad1..4509135 100644 --- a/cli/app/thesaurus/api.py +++ b/cli/app/thesaurus/api.py @@ -2,7 +2,6 @@ import os import re import time import requests -from hashlib import sha256 from app.utils.util import * from app.settings import app_cfg @@ -15,8 +14,7 @@ class Thesaurus: sha = sha256(word) hash_path = os.path.join(base_path, sha[0:2]) os.makedirs(hash_path, exist_ok=True) - clean_word = re.sub('[^0-9a-zA-Z]+', '*', word) - path = os.path.join(hash_path, clean_word + '.json') + path = os.path.join(hash_path, sha + '.json') if os.path.exists(path): return read_json(path) data = None -- cgit v1.2.3-70-g09d2