Debian Codegraph @

debian/patches/0001_read_unihan_from_debian_package.patch

raw symbols SCIP
1 From: =?utf-8?b?IllhbyBXZWkgKOmtj+mKmOW7tyki?= <[email protected]>
2 Date: Tue, 15 Feb 2022 09:56:04 +0800
3 Subject: Read Unihan_NumericValues.txt from local Debian package
4
5 ---
6 makeunicodedata.py | 9 ++-------
7 1 file changed, 2 insertions(+), 7 deletions(-)
8
9 diff --git a/makeunicodedata.py b/makeunicodedata.py
10 index 6dd8444..75c899e 100644
11 --- a/makeunicodedata.py
12 +++ b/makeunicodedata.py
13 @@ -1117,13 +1117,8 @@ class UnicodeData:
14 if table[i] is not None:
15 table[i].quick_check = quickchecks[i]
16
17 - with open_data(UNIHAN, version) as file:
18 - zip = zipfile.ZipFile(file)
19 - if version == '3.2.0':
20 - data = zip.open('Unihan-3.2.0.txt').read()
21 - else:
22 - data = zip.open('Unihan_NumericValues.txt').read()
23 - for line in data.decode("utf-8").splitlines():
24 + data = open(os.path.join(DATA_DIR, 'Unihan_NumericValues.txt'), encoding='utf-8')
25 + for line in data.readlines():
26 if not line.startswith('U+'):
27 continue
28 code, tag, value = line.split(None, 3)[:3]