summaryrefslogtreecommitdiff
path: root/src/make_unicode_property_data.py
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2018-12-21 20:06:28 +0100
committerJörg Frings-Fürst <debian@jff.email>2018-12-21 20:06:28 +0100
commitf883fa5bd37b6420f5dc25027a68289c64028063 (patch)
tree80452d3b1840e553402538830e903ed9fecdb3a8 /src/make_unicode_property_data.py
parent66dfd6613394a8903701840bbc9d67de537e597e (diff)
parentf1aff0cc17934fa45d9520dae6986562e033cb8f (diff)
Merge branch 'release/debian/6.9.1-1'debian/6.9.1-1
Diffstat (limited to 'src/make_unicode_property_data.py')
-rwxr-xr-xsrc/make_unicode_property_data.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/make_unicode_property_data.py b/src/make_unicode_property_data.py
index 9a48ced..dc3071a 100755
--- a/src/make_unicode_property_data.py
+++ b/src/make_unicode_property_data.py
@@ -6,8 +6,6 @@
import sys
import re
-INCLUDE_GRAPHEME_CLUSTER_DATA = False
-
POSIX_LIST = [
'NEWLINE', 'Alpha', 'Blank', 'Cntrl', 'Digit', 'Graph', 'Lower',
'Print', 'Punct', 'Space', 'Upper', 'XDigit', 'Word', 'Alnum', 'ASCII'
@@ -427,9 +425,17 @@ argv = sys.argv
argc = len(argv)
POSIX_ONLY = False
-if argc >= 2:
- if argv[1] == '-posix':
+INCLUDE_GRAPHEME_CLUSTER_DATA = False
+
+for i in range(1, argc):
+ arg = argv[i]
+ if arg == '-posix':
POSIX_ONLY = True
+ elif arg == '-gc':
+ INCLUDE_GRAPHEME_CLUSTER_DATA = True
+ else:
+ print >> sys.stderr, "Invalid argument: %s" % arg
+
OUTPUT_LIST_MODE = not(POSIX_ONLY)
@@ -441,11 +447,11 @@ with open('UnicodeData.txt', 'r') as f:
PROPS = DIC.keys()
PROPS = list_sub(PROPS, POSIX_LIST)
-dic, props = parse_and_merge_properties('DerivedCoreProperties.txt', 'Derived Property')
+parse_and_merge_properties('DerivedCoreProperties.txt', 'Derived Property')
dic, props = parse_and_merge_properties('Scripts.txt', 'Script')
DIC['Unknown'] = inverse_ranges(add_ranges_in_dic(dic))
-dic, props = parse_and_merge_properties('PropList.txt', 'Binary Property')
-dic, props = parse_and_merge_properties('emoji-data.txt', 'Emoji Property')
+parse_and_merge_properties('PropList.txt', 'Binary Property')
+parse_and_merge_properties('emoji-data.txt', 'Emoji Property')
PROPS.append('Unknown')
KDIC['Unknown'] = 'Script'