evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / python-modules / youseedee / 0001-use-packaged-unicode-data.patch
bloba1bc6fd92cc6ac3fb670d9a88c9a130baa88d0f3
1 diff --git a/lib/youseedee/__init__.py b/lib/youseedee/__init__.py
2 index 8db9c5f..9ad6618 100644
3 --- a/lib/youseedee/__init__.py
4 +++ b/lib/youseedee/__init__.py
5 @@ -38,12 +38,7 @@ UCD_URL = "https://unicode.org/Public/UCD/latest/ucd/UCD.zip"
7 def ucd_dir():
8 """Return the directory where Unicode data is stored"""
9 - ucddir = expanduser("~/.youseedee")
10 - try:
11 - os.mkdir(ucddir)
12 - except FileExistsError:
13 - pass
14 - return ucddir
15 + return "@ucd_dir@"
18 def up_to_date():
19 @@ -65,14 +60,6 @@ def up_to_date():
21 def ensure_files():
22 """Ensure the Unicode data files are downloaded and up to date, and download them if not"""
23 - if not os.path.isfile(os.path.join(ucd_dir(), "UnicodeData.txt")):
24 - download_files()
25 - if not up_to_date():
26 - # Remove the zip if it exists
27 - zip_path = os.path.join(ucd_dir(), "UCD.zip")
28 - if os.path.isfile(zip_path):
29 - os.unlink(zip_path)
30 - download_files()
31 return