nixpkgs/pkgs/development/python-modules/youseedee/0001-use-packaged-unicode-data.patch
2024-10-13 11:09:45 +02:00

34 lines
995 B
Diff

diff --git a/lib/youseedee/__init__.py b/lib/youseedee/__init__.py
index 8db9c5f..9ad6618 100644
--- a/lib/youseedee/__init__.py
+++ b/lib/youseedee/__init__.py
@@ -38,12 +38,7 @@ UCD_URL = "https://unicode.org/Public/UCD/latest/ucd/UCD.zip"
def ucd_dir():
"""Return the directory where Unicode data is stored"""
- ucddir = expanduser("~/.youseedee")
- try:
- os.mkdir(ucddir)
- except FileExistsError:
- pass
- return ucddir
+ return "@ucd_dir@"
def up_to_date():
@@ -65,14 +60,6 @@ def up_to_date():
def ensure_files():
"""Ensure the Unicode data files are downloaded and up to date, and download them if not"""
- if not os.path.isfile(os.path.join(ucd_dir(), "UnicodeData.txt")):
- download_files()
- if not up_to_date():
- # Remove the zip if it exists
- zip_path = os.path.join(ucd_dir(), "UCD.zip")
- if os.path.isfile(zip_path):
- os.unlink(zip_path)
- download_files()
return