Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit81ae8e2

Browse files
Specify unicode version in unicode.py
Ensures CI will keep passing until we choose to update
1 parentd7755f2 commit81ae8e2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎scripts/unicode.py‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@
2727
importos
2828
importre
2929
importsys
30+
importurllib.request
3031
fromcollectionsimportdefaultdict
3132
fromitertoolsimportbatched
3233

34+
UNICODE_VERSION="15.1.0"
35+
"""The version of the Unicode data files to download."""
36+
3337
NUM_CODEPOINTS=0x110000
3438
"""An upper bound for which `range(0, NUM_CODEPOINTS)` contains Unicode's codespace."""
3539

@@ -70,11 +74,13 @@ class OffsetType(enum.IntEnum):
7074

7175
deffetch_open(filename:str):
7276
"""Opens `filename` and return its corresponding file object. If `filename` isn't on disk,
73-
fetches it from `https://www.unicode.org/Public/UNIDATA/`. Exits with code 1 on failure.
77+
fetches it from `https://www.unicode.org/Public/`. Exits with code 1 on failure.
7478
"""
7579
basename=os.path.basename(filename)
7680
ifnotos.path.exists(basename):
77-
os.system(f"curl -O https://www.unicode.org/Public/UNIDATA/{filename}")
81+
urllib.request.urlretrieve(
82+
f"https://www.unicode.org/Public/{UNICODE_VERSION}/ucd/{filename}",basename
83+
)
7884
try:
7985
returnopen(basename,encoding="utf-8")
8086
exceptOSError:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp