summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2019-05-28 18:16:54 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2019-07-01 17:48:16 +0200
commitbbd64f64b235d04058ba5bd83886d76fa4ee7a0c (patch)
tree7fc25de51928b44ae75129912e7a9d1baecc065f /util
parent2f19a3053ea0216050a8eb76e6e062df9df1538d (diff)
cldr2qtimezone.py: report all missing zones, rather than just the first
When scanning the CLDR data, the script raised an exception if it didn't recognize a zone ID. Instead, collect up such unrecognized IDs in a list and report them all at the end, so that whoever runs this can do them all in one go, rather than doing one, running the script, doing the next, running the script, ad nauseam. Change-Id: Ia659f1d1c7e1c1b4ccb87cc23828a0588a5bf958 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-xutil/locale_database/cldr2qtimezone.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/util/locale_database/cldr2qtimezone.py b/util/locale_database/cldr2qtimezone.py
index 1c82e1d58f..809a35912b 100755
--- a/util/locale_database/cldr2qtimezone.py
+++ b/util/locale_database/cldr2qtimezone.py
@@ -293,6 +293,7 @@ defaultDict = {}
windowsIdDict = {}
if mapTimezones:
+ badZones = set()
for mapZone in mapTimezones:
# [u'mapZone', [(u'territory', u'MH'), (u'other', u'UTC+12'), (u'type', u'Pacific/Majuro Pacific/Kwajalein')]]
if mapZone[0] == u'mapZone':
@@ -307,7 +308,7 @@ if mapTimezones:
data['windowsKey'] = windowsIdToKey(data['windowsId'])
if data['windowsKey'] <= 0:
- raise xpathlite.Error("Unknown Windows ID, please add \"%s\"" % data['windowsId'])
+ badZones.add(data['windowsId'])
countryId = 0
if data['countryCode'] == u'001':
@@ -318,6 +319,10 @@ if mapTimezones:
raise xpathlite.Error("Unknown Country Code \"%s\"" % data['countryCode'])
data['country'] = enumdata.country_list[data['countryId']][0]
windowsIdDict[data['windowsKey'], data['countryId']] = data
+ if badZones:
+ sys.stderr.write('\n\t'.join(["\nUnknown Windows ID, please add:"] + sorted(badZones))
+ + "\nto the windowIdList in cldr2qtimezone.py\n\n")
+ raise xpathlite.Error("Unknown Windows IDs")
print "Input file parsed, now writing data"