From 6a390df8af534cc95c19a07ec2bbdd818ade6cac Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Mon, 10 Feb 2020 17:19:23 +0330 Subject: [PATCH] [tools] Print unicode links on gen-* tools output As Behdad's review --- src/gen-arabic-table.py | 13 +++++++------ src/gen-emoji-table.py | 7 ++++--- src/gen-indic-table.py | 12 ++++++------ src/gen-ucd-table.py | 7 ++++--- src/gen-use-table.py | 14 +++++++------- src/gen-vowel-constraints.py | 6 ++++-- 6 files changed, 32 insertions(+), 27 deletions(-) diff --git a/src/gen-arabic-table.py b/src/gen-arabic-table.py index 5e934a4c7..7fe26b098 100755 --- a/src/gen-arabic-table.py +++ b/src/gen-arabic-table.py @@ -1,16 +1,17 @@ #!/usr/bin/env python -# Input files: -# - https://unicode.org/Public/12.0.0/ucd/ArabicShaping.txt -# - https://unicode.org/Public/12.0.0/ucd/UnicodeData.txt -# - https://unicode.org/Public/12.0.0/ucd/Blocks.txt - from __future__ import print_function, division, absolute_import import io, os.path, sys if len (sys.argv) != 4: - print ("usage: ./gen-arabic-table.py ArabicShaping.txt UnicodeData.txt Blocks.txt", file=sys.stderr) + print ("""usage: ./gen-arabic-table.py ArabicShaping.txt UnicodeData.txt Blocks.txt + +Input files, as of Unicode 12: +* https://unicode.org/Public/UCD/latest/ucd/ArabicShaping.txt +* https://unicode.org/Public/UCD/latest/ucd/UnicodeData.txt +* https://unicode.org/Public/UCD/latest/ucd/Blocks.txt +""", file=sys.stderr) sys.exit (1) files = [io.open (x, encoding='utf-8') for x in sys.argv[1:]] diff --git a/src/gen-emoji-table.py b/src/gen-emoji-table.py index 037cdfd73..0dc0dcc07 100755 --- a/src/gen-emoji-table.py +++ b/src/gen-emoji-table.py @@ -1,7 +1,5 @@ #!/usr/bin/python -# Input file: https://www.unicode.org/Public/emoji/12.0/emoji-data.txt - from __future__ import print_function, division, absolute_import import sys import os.path @@ -9,7 +7,10 @@ from collections import OrderedDict import packTab if len (sys.argv) != 2: - print("usage: ./gen-emoji-table.py emoji-data.txt", file=sys.stderr) + print("""usage: ./gen-emoji-table.py emoji-data.txt + +Input file, as of Unicode 12: +* https://www.unicode.org/Public/emoji/12.0/emoji-data.txt""", file=sys.stderr) sys.exit (1) f = open(sys.argv[1]) diff --git a/src/gen-indic-table.py b/src/gen-indic-table.py index 6c75070f9..8f9f678a5 100755 --- a/src/gen-indic-table.py +++ b/src/gen-indic-table.py @@ -1,16 +1,16 @@ #!/usr/bin/env python -# Input files: -# - https://unicode.org/Public/12.0.0/ucd/IndicSyllabicCategory.txt -# - https://unicode.org/Public/12.0.0/ucd/IndicPositionalCategory.txt -# - https://unicode.org/Public/12.0.0/ucd/Blocks.txt - from __future__ import print_function, division, absolute_import import io, sys if len (sys.argv) != 4: - print ("usage: ./gen-indic-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt Blocks.txt", file=sys.stderr) + print ("""usage: ./gen-indic-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt Blocks.txt + +Input files, as of Unicode 12: +* https://unicode.org/Public/UCD/latest/ucd/IndicSyllabicCategory.txt +* https://unicode.org/Public/UCD/latest/ucd/IndicPositionalCategory.txt +* https://unicode.org/Public/UCD/latest/ucd/Blocks.txt""", file=sys.stderr) sys.exit (1) ALLOWED_SINGLES = [0x00A0, 0x25CC] diff --git a/src/gen-ucd-table.py b/src/gen-ucd-table.py index b2c5baada..1a01288f7 100755 --- a/src/gen-ucd-table.py +++ b/src/gen-ucd-table.py @@ -1,7 +1,5 @@ #!/usr/bin/env python -# Input file: http://unicode.org/Public/UCD/latest/ucdxml/ucd.nounihan.grouped.zip - from __future__ import print_function, division, absolute_import import io, os.path, sys, re @@ -9,7 +7,10 @@ import logging logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) if len (sys.argv) not in (2, 3): - print("usage: ./gen-ucd-table ucd.nounihan.grouped.xml [/path/to/hb-common.h]", file=sys.stderr) + print("""usage: ./gen-ucd-table ucd.nounihan.grouped.xml [/path/to/hb-common.h] + +Input file, as of Unicode 12: +* https://unicode.org/Public/UCD/latest/ucdxml/ucd.nounihan.grouped.zip""", file=sys.stderr) sys.exit(1) # https://github.com/harfbuzz/packtab diff --git a/src/gen-use-table.py b/src/gen-use-table.py index a070a4db1..bce99a47a 100755 --- a/src/gen-use-table.py +++ b/src/gen-use-table.py @@ -1,19 +1,19 @@ #!/usr/bin/env python # flake8: noqa -# Input files: -# - https://unicode.org/Public/12.0.0/ucd/IndicSyllabicCategory.txt -# - https://unicode.org/Public/12.0.0/ucd/IndicPositionalCategory.txt -# - https://unicode.org/Public/12.0.0/ucd/UnicodeData.txt -# - https://unicode.org/Public/12.0.0/ucd/Blocks.txt - from __future__ import print_function, division, absolute_import import io import sys if len (sys.argv) != 5: - print ("usage: ./gen-use-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt UnicodeData.txt Blocks.txt", file=sys.stderr) + print ("""usage: ./gen-use-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt UnicodeData.txt Blocks.txt + +Input file, as of Unicode 12: +* https://unicode.org/Public/UCD/latest/ucd/IndicSyllabicCategory.txt +* https://unicode.org/Public/UCD/latest/ucd/IndicPositionalCategory.txt +* https://unicode.org/Public/UCD/latest/ucd/UnicodeData.txt +* https://unicode.org/Public/UCD/latest/ucd/Blocks.txt""", file=sys.stderr) sys.exit (1) BLACKLISTED_BLOCKS = ["Thai", "Lao"] diff --git a/src/gen-vowel-constraints.py b/src/gen-vowel-constraints.py index ab5852bbc..3d5d6a689 100755 --- a/src/gen-vowel-constraints.py +++ b/src/gen-vowel-constraints.py @@ -7,7 +7,6 @@ circles into sequences prohibited by the USE script development spec. This function should be used as the ``preprocess_text`` of an ``hb_ot_complex_shaper_t``. -Input file: https://unicode.org/Public/12.0.0/ucd/Scripts.txt """ from __future__ import absolute_import, division, print_function, unicode_literals @@ -27,7 +26,10 @@ import io import sys if len (sys.argv) != 3: - print ('usage: ./gen-vowel-constraints.py ms-use/IndicShapingInvalidCluster.txt Scripts.txt', file=sys.stderr) + print ("""usage: ./gen-vowel-constraints.py ms-use/IndicShapingInvalidCluster.txt Scripts.txt + +Input file, as of Unicode 12: +* https://unicode.org/Public/UCD/latest/ucd/Scripts.txt""", file=sys.stderr) sys.exit (1) with io.open (sys.argv[2], encoding='utf-8') as f: