backrefs 5.8__tar.gz → 5.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {backrefs-5.8 → backrefs-5.9}/LICENSE.md +1 -1
- {backrefs-5.8 → backrefs-5.9}/PKG-INFO +6 -7
- {backrefs-5.8 → backrefs-5.9}/README.md +4 -6
- {backrefs-5.8 → backrefs-5.9}/backrefs/__meta__.py +1 -1
- {backrefs-5.8 → backrefs-5.9}/docs/src/markdown/about/changelog.md +5 -0
- {backrefs-5.8 → backrefs-5.9}/docs/src/markdown/refs.md +1 -1
- {backrefs-5.8 → backrefs-5.9}/hatch_build.py +1 -0
- {backrefs-5.8 → backrefs-5.9}/mkdocs.yml +1 -3
- {backrefs-5.8 → backrefs-5.9}/pyproject.toml +2 -2
- {backrefs-5.8 → backrefs-5.9}/tools/unipropgen.py +30 -31
- backrefs-5.8/tools/unicodedata/11.0.0.zip +0 -0
- {backrefs-5.8 → backrefs-5.9}/.coveragerc +0 -0
- {backrefs-5.8 → backrefs-5.9}/.gitignore +0 -0
- {backrefs-5.8 → backrefs-5.9}/.pyspelling.yml +0 -0
- {backrefs-5.8 → backrefs-5.9}/backrefs/__init__.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/backrefs/_bre_parse.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/backrefs/_bregex_parse.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/backrefs/_bregex_typing.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/backrefs/bre.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/backrefs/bregex.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/backrefs/py.typed +0 -0
- {backrefs-5.8 → backrefs-5.9}/backrefs/uniprops/__init__.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/backrefs/util.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/docs/src/markdown/.snippets/links.md +0 -0
- {backrefs-5.8 → backrefs-5.9}/docs/src/markdown/about/contributing.md +0 -0
- {backrefs-5.8 → backrefs-5.9}/docs/src/markdown/about/license.md +0 -0
- {backrefs-5.8 → backrefs-5.9}/docs/src/markdown/about/security.md +0 -0
- {backrefs-5.8 → backrefs-5.9}/docs/src/markdown/index.md +0 -0
- {backrefs-5.8 → backrefs-5.9}/docs/src/markdown/usage.md +0 -0
- {backrefs-5.8 → backrefs-5.9}/docs/theme/announce.html +0 -0
- {backrefs-5.8 → backrefs-5.9}/requirements/docs.txt +0 -0
- {backrefs-5.8 → backrefs-5.9}/requirements/lint.txt +0 -0
- {backrefs-5.8 → backrefs-5.9}/requirements/test.txt +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/__init__.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_age.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_bidiclass.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_bidipairedbrackettype.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_binary.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_block.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_bre.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_bregex.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_canonicalcombiningclass.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_decompositiontype.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_eastasianwidth.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_generalcategory.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_graphemeclusterbreak.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_hangulsyllabletype.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_indicpositionalcategory.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_indicsylabiccategory.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_joininggroup.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_joiningtype.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_linebreak.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_numerictype.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_numericvalue.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_quickcheck.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_script.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_scriptextensions.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_sentencebreak.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_uniprops.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_versions.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_verticalorientation.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tests/test_wordbreak.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tools/__init__.py +0 -0
- {backrefs-5.8 → backrefs-5.9}/tools/unicodedata/13.0.0.zip +0 -0
- {backrefs-5.8 → backrefs-5.9}/tools/unicodedata/14.0.0.zip +0 -0
- {backrefs-5.8 → backrefs-5.9}/tools/unicodedata/15.0.0.zip +0 -0
- {backrefs-5.8 → backrefs-5.9}/tools/unicodedata/15.1.0.zip +0 -0
- {backrefs-5.8 → backrefs-5.9}/tools/unicodedata/16.0.0.zip +0 -0
- {backrefs-5.8 → backrefs-5.9}/tools/unicodedata/LICENSE +0 -0
- {backrefs-5.8 → backrefs-5.9}/tools/unidatadownload.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: backrefs
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.9
|
|
4
4
|
Summary: A wrapper around re and regex that adds additional back references.
|
|
5
5
|
Project-URL: Homepage, https://github.com/facelessuser/backrefs
|
|
6
6
|
Author-email: Isaac Muse <Isaac.Muse@gmail.com>
|
|
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
22
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
23
|
Classifier: Typing :: Typed
|
|
23
24
|
Requires-Python: >=3.9
|
|
@@ -26,13 +27,12 @@ Requires-Dist: regex; extra == 'extras'
|
|
|
26
27
|
Description-Content-Type: text/markdown
|
|
27
28
|
|
|
28
29
|
[![Donate via PayPal][donate-image]][donate-link]
|
|
29
|
-
[![Discord][discord-image]][discord-link]
|
|
30
30
|
[![Build][github-ci-image]][github-ci-link]
|
|
31
31
|
[![Coverage Status][codecov-image]][codecov-link]
|
|
32
32
|
[![PyPI Version][pypi-image]][pypi-link]
|
|
33
33
|
[![PyPI Downloads][pypi-down]][pypi-link]
|
|
34
34
|
[![PyPI - Python Version][python-image]][pypi-link]
|
|
35
|
-
![License][license-image-mit]
|
|
35
|
+
[![License][license-image-mit]][license-link]
|
|
36
36
|
|
|
37
37
|
# Backrefs
|
|
38
38
|
|
|
@@ -42,7 +42,7 @@ Python's Re and/or Regex. The supported back references actually vary depending
|
|
|
42
42
|
used as the engine may already have support for some.
|
|
43
43
|
|
|
44
44
|
```python
|
|
45
|
-
from backrefs import bre
|
|
45
|
+
>>> from backrefs import bre
|
|
46
46
|
>>> pattern = bre.compile(r'(\p{Letter}+)')
|
|
47
47
|
>>> pattern.sub(r'\C\1\E', 'sometext')
|
|
48
48
|
'SOMETEXT'
|
|
@@ -56,10 +56,8 @@ https://facelessuser.github.io/backrefs/
|
|
|
56
56
|
|
|
57
57
|
MIT
|
|
58
58
|
|
|
59
|
-
[github-ci-image]: https://github.com/facelessuser/backrefs/workflows/build/badge.svg
|
|
59
|
+
[github-ci-image]: https://github.com/facelessuser/backrefs/workflows/build/badge.svg
|
|
60
60
|
[github-ci-link]: https://github.com/facelessuser/backrefs/actions?query=workflow%3Abuild+branch%3Amaster
|
|
61
|
-
[discord-image]: https://img.shields.io/discord/678289859768745989?logo=discord&logoColor=aaaaaa&color=mediumpurple&labelColor=333333
|
|
62
|
-
[discord-link]:https://discord.gg/TWs8Tgr
|
|
63
61
|
[codecov-image]: https://img.shields.io/codecov/c/github/facelessuser/backrefs/master.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333
|
|
64
62
|
[codecov-link]: https://codecov.io/github/facelessuser/backrefs
|
|
65
63
|
[pypi-image]: https://img.shields.io/pypi/v/backrefs.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333
|
|
@@ -67,6 +65,7 @@ MIT
|
|
|
67
65
|
[pypi-link]: https://pypi.python.org/pypi/backrefs
|
|
68
66
|
[python-image]: https://img.shields.io/pypi/pyversions/backrefs?logo=python&logoColor=aaaaaa&labelColor=333333
|
|
69
67
|
[license-image-mit]: https://img.shields.io/badge/license-MIT-blue.svg?labelColor=333333
|
|
68
|
+
[license-link]: https://github.com/facelessuser/backrefs/blob/main/LICENSE.md
|
|
70
69
|
[donate-image]: https://img.shields.io/badge/Donate-PayPal-3fabd1?logo=paypal
|
|
71
70
|
[donate-link]: https://www.paypal.me/facelessuser
|
|
72
71
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
[![Donate via PayPal][donate-image]][donate-link]
|
|
2
|
-
[![Discord][discord-image]][discord-link]
|
|
3
2
|
[![Build][github-ci-image]][github-ci-link]
|
|
4
3
|
[![Coverage Status][codecov-image]][codecov-link]
|
|
5
4
|
[![PyPI Version][pypi-image]][pypi-link]
|
|
6
5
|
[![PyPI Downloads][pypi-down]][pypi-link]
|
|
7
6
|
[![PyPI - Python Version][python-image]][pypi-link]
|
|
8
|
-
![License][license-image-mit]
|
|
7
|
+
[![License][license-image-mit]][license-link]
|
|
9
8
|
|
|
10
9
|
# Backrefs
|
|
11
10
|
|
|
@@ -15,7 +14,7 @@ Python's Re and/or Regex. The supported back references actually vary depending
|
|
|
15
14
|
used as the engine may already have support for some.
|
|
16
15
|
|
|
17
16
|
```python
|
|
18
|
-
from backrefs import bre
|
|
17
|
+
>>> from backrefs import bre
|
|
19
18
|
>>> pattern = bre.compile(r'(\p{Letter}+)')
|
|
20
19
|
>>> pattern.sub(r'\C\1\E', 'sometext')
|
|
21
20
|
'SOMETEXT'
|
|
@@ -29,10 +28,8 @@ https://facelessuser.github.io/backrefs/
|
|
|
29
28
|
|
|
30
29
|
MIT
|
|
31
30
|
|
|
32
|
-
[github-ci-image]: https://github.com/facelessuser/backrefs/workflows/build/badge.svg
|
|
31
|
+
[github-ci-image]: https://github.com/facelessuser/backrefs/workflows/build/badge.svg
|
|
33
32
|
[github-ci-link]: https://github.com/facelessuser/backrefs/actions?query=workflow%3Abuild+branch%3Amaster
|
|
34
|
-
[discord-image]: https://img.shields.io/discord/678289859768745989?logo=discord&logoColor=aaaaaa&color=mediumpurple&labelColor=333333
|
|
35
|
-
[discord-link]:https://discord.gg/TWs8Tgr
|
|
36
33
|
[codecov-image]: https://img.shields.io/codecov/c/github/facelessuser/backrefs/master.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333
|
|
37
34
|
[codecov-link]: https://codecov.io/github/facelessuser/backrefs
|
|
38
35
|
[pypi-image]: https://img.shields.io/pypi/v/backrefs.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333
|
|
@@ -40,6 +37,7 @@ MIT
|
|
|
40
37
|
[pypi-link]: https://pypi.python.org/pypi/backrefs
|
|
41
38
|
[python-image]: https://img.shields.io/pypi/pyversions/backrefs?logo=python&logoColor=aaaaaa&labelColor=333333
|
|
42
39
|
[license-image-mit]: https://img.shields.io/badge/license-MIT-blue.svg?labelColor=333333
|
|
40
|
+
[license-link]: https://github.com/facelessuser/backrefs/blob/main/LICENSE.md
|
|
43
41
|
[donate-image]: https://img.shields.io/badge/Donate-PayPal-3fabd1?logo=paypal
|
|
44
42
|
[donate-link]: https://www.paypal.me/facelessuser
|
|
45
43
|
|
|
@@ -193,5 +193,5 @@ def parse_version(ver: str) -> Version:
|
|
|
193
193
|
return Version(major, minor, micro, release, pre, post, dev)
|
|
194
194
|
|
|
195
195
|
|
|
196
|
-
__version_info__ = Version(5,
|
|
196
|
+
__version_info__ = Version(5, 9, 0, "final")
|
|
197
197
|
__version__ = __version_info__._get_canonical()
|
|
@@ -199,7 +199,7 @@ Block properties have a similar short form as Script and Binary properties. For
|
|
|
199
199
|
a block. If we wanted to match characters in the `Basic_Latin` block, we could use the syntax `\p{InBasic_Latin}`. This
|
|
200
200
|
would be the same as `\p{Block: Basic_Latin}` or `\p{Basic_Latin}`.
|
|
201
201
|
|
|
202
|
-
///
|
|
202
|
+
/// warning | Short Name Conflicts
|
|
203
203
|
When it comes to short names, each new Unicode version, there is a risk that new properties could cause conflicts
|
|
204
204
|
with existing names and/or aliases. Currently, most of the conflicts involve the Block properties. To reduce
|
|
205
205
|
friction, they are evaluated last.
|
|
@@ -79,6 +79,7 @@ class CustomMetadataHook(MetadataHookInterface):
|
|
|
79
79
|
'Programming Language :: Python :: 3.11',
|
|
80
80
|
'Programming Language :: Python :: 3.12',
|
|
81
81
|
'Programming Language :: Python :: 3.13',
|
|
82
|
+
'Programming Language :: Python :: 3.14',
|
|
82
83
|
'Topic :: Software Development :: Libraries :: Python Modules',
|
|
83
84
|
'Typing :: Typed'
|
|
84
85
|
]
|
|
@@ -4,7 +4,7 @@ repo_url: https://github.com/facelessuser/backrefs
|
|
|
4
4
|
edit_uri: tree/master/docs/src/markdown
|
|
5
5
|
site_description: A library to add additional back references to regular expressions.
|
|
6
6
|
copyright: |
|
|
7
|
-
Copyright © 2015 -
|
|
7
|
+
Copyright © 2015 - 2025 <a href="https://github.com/facelessuser" target="_blank" rel="noopener">Isaac Muse</a>
|
|
8
8
|
|
|
9
9
|
docs_dir: docs/src/markdown
|
|
10
10
|
theme:
|
|
@@ -152,8 +152,6 @@ extra:
|
|
|
152
152
|
social:
|
|
153
153
|
- icon: fontawesome/brands/github
|
|
154
154
|
link: https://github.com/facelessuser
|
|
155
|
-
- icon: fontawesome/brands/discord
|
|
156
|
-
link: https://discord.gg/TWs8Tgr
|
|
157
155
|
|
|
158
156
|
plugins:
|
|
159
157
|
- search
|
|
@@ -135,7 +135,7 @@ legacy_tox_ini = """
|
|
|
135
135
|
[tox]
|
|
136
136
|
isolated_build = true
|
|
137
137
|
envlist =
|
|
138
|
-
py39,py310,py311,py312,py313,
|
|
138
|
+
py39,py310,py311,py312,py313,py314,
|
|
139
139
|
lint
|
|
140
140
|
|
|
141
141
|
[testenv]
|
|
@@ -157,7 +157,7 @@ passenv = *
|
|
|
157
157
|
deps=
|
|
158
158
|
-r requirements/docs.txt
|
|
159
159
|
commands=
|
|
160
|
-
{
|
|
160
|
+
{envbindir}/mkdocs build --clean --verbose --strict
|
|
161
161
|
{envbindir}/pyspelling
|
|
162
162
|
|
|
163
163
|
[testenv:lint]
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Generate a Unicode prop table for Python builds."""
|
|
2
2
|
import sys
|
|
3
3
|
import unicodedata
|
|
4
|
-
import codecs
|
|
5
4
|
import os
|
|
6
5
|
import re
|
|
7
6
|
|
|
@@ -201,7 +200,7 @@ def discover_categories():
|
|
|
201
200
|
|
|
202
201
|
# NF Quick Check categories
|
|
203
202
|
file_name = os.path.join(HOME, 'unicodedata', UNIVERSION, 'DerivedNormalizationProps.txt')
|
|
204
|
-
with
|
|
203
|
+
with open(file_name, 'r', encoding='utf-8') as uf:
|
|
205
204
|
for line in uf:
|
|
206
205
|
if not line.startswith('#'):
|
|
207
206
|
data = line.split('#')[0].split(';')
|
|
@@ -227,7 +226,7 @@ def discover_categories():
|
|
|
227
226
|
binary_props.append(('emoji-data.txt', None))
|
|
228
227
|
|
|
229
228
|
for filename, include in binary_props:
|
|
230
|
-
with
|
|
229
|
+
with open(os.path.join(HOME, 'unicodedata', UNIVERSION, filename), 'r', encoding='utf-8') as uf:
|
|
231
230
|
for line in uf:
|
|
232
231
|
if not line.startswith('#'):
|
|
233
232
|
data = line.split('#')[0].split(';')
|
|
@@ -245,7 +244,7 @@ def discover_categories():
|
|
|
245
244
|
def gen_blocks(output, ascii_props=False, append=False, prefix="", aliases=None):
|
|
246
245
|
"""Generate Unicode blocks."""
|
|
247
246
|
|
|
248
|
-
with
|
|
247
|
+
with open(output, 'a' if append else 'w', encoding='utf-8') as f:
|
|
249
248
|
if not append:
|
|
250
249
|
f.write(HEADER.format(UNIVERSION, TYPING))
|
|
251
250
|
f.write('%s_blocks: dict[str, str] = {' % prefix)
|
|
@@ -257,7 +256,7 @@ def gen_blocks(output, ascii_props=False, append=False, prefix="", aliases=None)
|
|
|
257
256
|
max_range = MAXUNICODE
|
|
258
257
|
formatter = uniformat
|
|
259
258
|
|
|
260
|
-
with
|
|
259
|
+
with open(os.path.join(HOME, 'unicodedata', UNIVERSION, 'Blocks.txt'), 'r', encoding='utf-8') as uf:
|
|
261
260
|
for line in uf:
|
|
262
261
|
if not line.startswith('#'):
|
|
263
262
|
data = line.split(';')
|
|
@@ -321,7 +320,7 @@ def gen_ccc(output, ascii_props=False, append=False, prefix="", aliases=None):
|
|
|
321
320
|
for v in aliases.get('canonicalcombiningclass', {}).values():
|
|
322
321
|
obj[v] = []
|
|
323
322
|
|
|
324
|
-
with
|
|
323
|
+
with open(os.path.join(HOME, 'unicodedata', UNIVERSION, 'DerivedCombiningClass.txt'), 'r', encoding='utf-8') as uf:
|
|
325
324
|
for line in uf:
|
|
326
325
|
if not line.startswith('#'):
|
|
327
326
|
data = line.split('#')[0].split(';')
|
|
@@ -350,7 +349,7 @@ def gen_ccc(output, ascii_props=False, append=False, prefix="", aliases=None):
|
|
|
350
349
|
# Convert characters values to ranges
|
|
351
350
|
char2range(obj, is_bytes=ascii_props)
|
|
352
351
|
|
|
353
|
-
with
|
|
352
|
+
with open(output, 'a' if append else 'w', encoding='utf-8') as f:
|
|
354
353
|
if not append:
|
|
355
354
|
f.write(HEADER.format(UNIVERSION, TYPING))
|
|
356
355
|
# Write out the Unicode properties
|
|
@@ -382,13 +381,13 @@ def gen_scripts(
|
|
|
382
381
|
obj2[v] = []
|
|
383
382
|
|
|
384
383
|
alias = {}
|
|
385
|
-
with
|
|
384
|
+
with open(os.path.join(HOME, 'unicodedata', UNIVERSION, 'PropertyValueAliases.txt'), 'r', encoding='utf-8') as uf:
|
|
386
385
|
for line in uf:
|
|
387
386
|
if line.startswith('sc ;'):
|
|
388
387
|
values = line.split(';')
|
|
389
388
|
alias[format_name(values[1].strip())] = format_name(values[2].strip())
|
|
390
389
|
|
|
391
|
-
with
|
|
390
|
+
with open(os.path.join(HOME, 'unicodedata', UNIVERSION, file_name_ext), 'r', encoding='utf-8') as uf:
|
|
392
391
|
for line in uf:
|
|
393
392
|
if not line.startswith('#'):
|
|
394
393
|
data = line.split('#')[0].split(';')
|
|
@@ -404,7 +403,7 @@ def gen_scripts(
|
|
|
404
403
|
|
|
405
404
|
obj2[ext].extend(span)
|
|
406
405
|
|
|
407
|
-
with
|
|
406
|
+
with open(os.path.join(HOME, 'unicodedata', UNIVERSION, file_name), 'r', encoding='utf-8') as uf:
|
|
408
407
|
for line in uf:
|
|
409
408
|
if not line.startswith('#'):
|
|
410
409
|
data = line.split('#')[0].split(';')
|
|
@@ -439,7 +438,7 @@ def gen_scripts(
|
|
|
439
438
|
char2range(obj, is_bytes=ascii_props)
|
|
440
439
|
char2range(obj2, is_bytes=ascii_props)
|
|
441
440
|
|
|
442
|
-
with
|
|
441
|
+
with open(output, 'a' if append else 'w', encoding='utf-8') as f:
|
|
443
442
|
if not append:
|
|
444
443
|
f.write(HEADER.format(UNIVERSION, TYPING))
|
|
445
444
|
# Write out the Unicode properties
|
|
@@ -454,7 +453,7 @@ def gen_scripts(
|
|
|
454
453
|
f.write(',\n')
|
|
455
454
|
i += 1
|
|
456
455
|
|
|
457
|
-
with
|
|
456
|
+
with open(output_ext, 'a' if append else 'w', encoding='utf-8') as f:
|
|
458
457
|
if not append:
|
|
459
458
|
f.write(HEADER.format(UNIVERSION, TYPING))
|
|
460
459
|
# Write out the Unicode properties
|
|
@@ -482,7 +481,7 @@ def gen_enum(
|
|
|
482
481
|
for v in aliases.get(format_name(obj_name), {}).values():
|
|
483
482
|
obj[v] = []
|
|
484
483
|
|
|
485
|
-
with
|
|
484
|
+
with open(os.path.join(HOME, 'unicodedata', UNIVERSION, file_name), 'r', encoding='utf-8') as uf:
|
|
486
485
|
for line in uf:
|
|
487
486
|
if not line.startswith('#'):
|
|
488
487
|
data = line.split('#')[0].split(';')
|
|
@@ -508,7 +507,7 @@ def gen_enum(
|
|
|
508
507
|
# Convert characters values to ranges
|
|
509
508
|
char2range(obj, is_bytes=ascii_props)
|
|
510
509
|
|
|
511
|
-
with
|
|
510
|
+
with open(output, 'a' if append else 'w', encoding='utf-8') as f:
|
|
512
511
|
if not append:
|
|
513
512
|
f.write(HEADER.format(UNIVERSION, TYPING))
|
|
514
513
|
# Write out the Unicode properties
|
|
@@ -535,7 +534,7 @@ def gen_age(output, ascii_props=False, append=False, prefix="", aliases=None):
|
|
|
535
534
|
obj[v] = []
|
|
536
535
|
|
|
537
536
|
all_chars = (ALL_CHARS - ASCII_UNUSED) if ascii_props else ALL_CHARS
|
|
538
|
-
with
|
|
537
|
+
with open(os.path.join(HOME, 'unicodedata', UNIVERSION, 'DerivedAge.txt'), 'r', encoding='utf-8') as uf:
|
|
539
538
|
for line in uf:
|
|
540
539
|
if not line.startswith('#'):
|
|
541
540
|
data = line.split('#')[0].split(';')
|
|
@@ -564,7 +563,7 @@ def gen_age(output, ascii_props=False, append=False, prefix="", aliases=None):
|
|
|
564
563
|
# Convert characters values to ranges
|
|
565
564
|
char2range(obj, is_bytes=ascii_props)
|
|
566
565
|
|
|
567
|
-
with
|
|
566
|
+
with open(output, 'a' if append else 'w', encoding='utf-8') as f:
|
|
568
567
|
if not append:
|
|
569
568
|
f.write(HEADER.format(UNIVERSION, TYPING))
|
|
570
569
|
# Write out the Unicode properties
|
|
@@ -586,7 +585,7 @@ def gen_nf_quick_check(output, ascii_props=False, append=False, prefix="", alias
|
|
|
586
585
|
nf = {}
|
|
587
586
|
all_chars = (ALL_CHARS - ASCII_UNUSED) if ascii_props else ALL_CHARS
|
|
588
587
|
file_name = os.path.join(HOME, 'unicodedata', UNIVERSION, 'DerivedNormalizationProps.txt')
|
|
589
|
-
with
|
|
588
|
+
with open(file_name, 'r', encoding='utf-8') as uf:
|
|
590
589
|
for line in uf:
|
|
591
590
|
if not line.startswith('#'):
|
|
592
591
|
data = line.split('#')[0].split(';')
|
|
@@ -626,7 +625,7 @@ def gen_nf_quick_check(output, ascii_props=False, append=False, prefix="", alias
|
|
|
626
625
|
# Convert characters values to ranges
|
|
627
626
|
char2range(nf, is_bytes=ascii_props)
|
|
628
627
|
|
|
629
|
-
with
|
|
628
|
+
with open(output, 'a' if append else 'w', encoding='utf-8') as f:
|
|
630
629
|
if not append:
|
|
631
630
|
f.write(HEADER.format(UNIVERSION, TYPING))
|
|
632
631
|
for key, value in sorted(nf.items()):
|
|
@@ -670,7 +669,7 @@ def gen_binary(table, output, ascii_props=False, append=False, prefix="", aliase
|
|
|
670
669
|
binary['vertspace'] = [x for x in binary['vertspace'] if x <= max_range]
|
|
671
670
|
|
|
672
671
|
for filename, include in binary_props:
|
|
673
|
-
with
|
|
672
|
+
with open(os.path.join(HOME, 'unicodedata', UNIVERSION, filename), 'r', encoding='utf-8') as uf:
|
|
674
673
|
for line in uf:
|
|
675
674
|
if not line.startswith('#'):
|
|
676
675
|
data = line.split('#')[0].split(';')
|
|
@@ -687,7 +686,7 @@ def gen_binary(table, output, ascii_props=False, append=False, prefix="", aliase
|
|
|
687
686
|
continue
|
|
688
687
|
binary[name].extend(span)
|
|
689
688
|
|
|
690
|
-
with
|
|
689
|
+
with open(os.path.join(HOME, 'unicodedata', UNIVERSION, 'CompositionExclusions.txt'), 'r', encoding='utf-8') as uf:
|
|
691
690
|
name = 'compositionexclusion'
|
|
692
691
|
for line in uf:
|
|
693
692
|
if not line.startswith('#'):
|
|
@@ -703,7 +702,7 @@ def gen_binary(table, output, ascii_props=False, append=False, prefix="", aliase
|
|
|
703
702
|
binary[name].extend(span)
|
|
704
703
|
|
|
705
704
|
file_name = os.path.join(HOME, 'unicodedata', UNIVERSION, 'DerivedNormalizationProps.txt')
|
|
706
|
-
with
|
|
705
|
+
with open(file_name, 'r', encoding='utf-8') as uf:
|
|
707
706
|
name = "fullcompositionexclusion"
|
|
708
707
|
for line in uf:
|
|
709
708
|
if not line.startswith('#'):
|
|
@@ -720,7 +719,7 @@ def gen_binary(table, output, ascii_props=False, append=False, prefix="", aliase
|
|
|
720
719
|
binary[name] = []
|
|
721
720
|
binary[name].extend(span)
|
|
722
721
|
|
|
723
|
-
with
|
|
722
|
+
with open(os.path.join(HOME, 'unicodedata', UNIVERSION, 'UnicodeData.txt'), 'r', encoding='utf-8') as uf:
|
|
724
723
|
name = 'bidimirrored'
|
|
725
724
|
for line in uf:
|
|
726
725
|
data = line.strip().split(';')
|
|
@@ -759,7 +758,7 @@ def gen_binary(table, output, ascii_props=False, append=False, prefix="", aliase
|
|
|
759
758
|
# Convert characters values to ranges
|
|
760
759
|
char2range(binary, is_bytes=ascii_props)
|
|
761
760
|
|
|
762
|
-
with
|
|
761
|
+
with open(output, 'a' if append else 'w', encoding='utf-8') as f:
|
|
763
762
|
if not append:
|
|
764
763
|
f.write(HEADER.format(UNIVERSION, TYPING))
|
|
765
764
|
# Write out the Unicode properties
|
|
@@ -786,7 +785,7 @@ def gen_bidi(output, ascii_props=False, append=False, prefix="", aliases=None):
|
|
|
786
785
|
bidi_class[v] = []
|
|
787
786
|
|
|
788
787
|
max_range = MAXVALIDASCII if ascii_props else MAXUNICODE
|
|
789
|
-
with
|
|
788
|
+
with open(os.path.join(HOME, 'unicodedata', UNIVERSION, 'UnicodeData.txt'), 'r', encoding='utf-8') as uf:
|
|
790
789
|
for line in uf:
|
|
791
790
|
data = line.strip().split(';')
|
|
792
791
|
if data:
|
|
@@ -810,7 +809,7 @@ def gen_bidi(output, ascii_props=False, append=False, prefix="", aliases=None):
|
|
|
810
809
|
# Convert characters values to ranges
|
|
811
810
|
char2range(bidi_class, is_bytes=ascii_props)
|
|
812
811
|
|
|
813
|
-
with
|
|
812
|
+
with open(output, 'a' if append else 'w', encoding='utf-8') as f:
|
|
814
813
|
if not append:
|
|
815
814
|
f.write(HEADER.format(UNIVERSION, TYPING))
|
|
816
815
|
f.write('%s_bidi_classes: dict[str, str] = {\n' % prefix)
|
|
@@ -913,7 +912,7 @@ def gen_alias(nonbinary, binary, output):
|
|
|
913
912
|
'catalog', 'enumerated', 'numeric', 'miscellaneous'
|
|
914
913
|
)
|
|
915
914
|
|
|
916
|
-
with
|
|
915
|
+
with open(os.path.join(HOME, 'unicodedata', UNIVERSION, 'PropertyAliases.txt'), 'r', encoding='utf-8') as uf:
|
|
917
916
|
div = False
|
|
918
917
|
capture = False
|
|
919
918
|
name = None
|
|
@@ -952,7 +951,7 @@ def gen_alias(nonbinary, binary, output):
|
|
|
952
951
|
for d in data[1:]:
|
|
953
952
|
alias[name][d] = data[0]
|
|
954
953
|
|
|
955
|
-
with
|
|
954
|
+
with open(os.path.join(HOME, 'unicodedata', UNIVERSION, 'PropertyValueAliases.txt'), 'r', encoding='utf-8') as uf:
|
|
956
955
|
for line in uf:
|
|
957
956
|
m = alias_re.match(line)
|
|
958
957
|
if m:
|
|
@@ -992,7 +991,7 @@ def gen_alias(nonbinary, binary, output):
|
|
|
992
991
|
alias['binary']['h'] = 'horizspace'
|
|
993
992
|
alias['binary']['v'] = 'vertspace'
|
|
994
993
|
|
|
995
|
-
with
|
|
994
|
+
with open(output, 'w', encoding='utf-8') as f:
|
|
996
995
|
f.write(HEADER.format(UNIVERSION, TYPING))
|
|
997
996
|
f.write('%s_alias: dict[str, dict[str, str]] = {\n' % prefix)
|
|
998
997
|
count = len(alias) - 1
|
|
@@ -1037,7 +1036,7 @@ def gen_properties(output, files, aliases, ascii_props=False, append=False):
|
|
|
1037
1036
|
# before sending it through.
|
|
1038
1037
|
table = {'l': {'c': []}}
|
|
1039
1038
|
itable = {'l': {}}
|
|
1040
|
-
with
|
|
1039
|
+
with open(os.path.join(HOME, 'unicodedata', UNIVERSION, 'UnicodeData.txt'), 'r', encoding='utf-8') as uf:
|
|
1041
1040
|
for line in uf:
|
|
1042
1041
|
data = line.strip().split(';')
|
|
1043
1042
|
if data:
|
|
@@ -1194,7 +1193,7 @@ def gen_properties(output, files, aliases, ascii_props=False, append=False):
|
|
|
1194
1193
|
for k1, v1 in itable.items():
|
|
1195
1194
|
table[k1]['^'] = v1['^']
|
|
1196
1195
|
|
|
1197
|
-
with
|
|
1196
|
+
with open(files['gc'], 'a' if append else 'w', encoding='utf-8') as f:
|
|
1198
1197
|
if not append:
|
|
1199
1198
|
f.write(HEADER.format(UNIVERSION, TYPING))
|
|
1200
1199
|
# Write out the Unicode properties
|
|
@@ -1219,7 +1218,7 @@ def gen_properties(output, files, aliases, ascii_props=False, append=False):
|
|
|
1219
1218
|
i += 1
|
|
1220
1219
|
|
|
1221
1220
|
if not append:
|
|
1222
|
-
with
|
|
1221
|
+
with open(os.path.join(output, '__init__.py'), 'w') as f:
|
|
1223
1222
|
f.write(HEADER.format(UNIVERSION, ''))
|
|
1224
1223
|
for x in sorted(files):
|
|
1225
1224
|
f.write('from .%s import * # noqa\n' % os.path.basename(files[x])[:-3])
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|