summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-05-04 12:12:00 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2021-05-26 18:00:01 +0200
commit21e0ef3ccf653fad76516ef89c62c2fb9fb4d9b5 (patch)
tree86677b8f32b4b713e71c13d596719ccaffb5985f /util
parent181424d9b57512ffcc8b1589351683899bf7febe (diff)
Rename util/locale_database/enumdata.py's various *_list to *_map
These variables provide mappings, not lists, so name them non-deceptively. Change-Id: Idf15e78ad73790bc86dd8b9d4f248d1c4f73993c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'util')
-rw-r--r--util/locale_database/cldr.py18
-rw-r--r--util/locale_database/enumdata.py8
-rw-r--r--util/locale_database/qlocalexml.py8
3 files changed, 17 insertions, 17 deletions
diff --git a/util/locale_database/cldr.py b/util/locale_database/cldr.py
index 9b08d8a652..40112537f0 100644
--- a/util/locale_database/cldr.py
+++ b/util/locale_database/cldr.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8; -*-
#############################################################################
##
-## Copyright (C) 2020 The Qt Company Ltd.
+## Copyright (C) 2021 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of the Qt Toolkit.
@@ -410,10 +410,10 @@ class CldrAccess (object):
for k in self.__parentLocale.keys():
for f in k.split('_'):
scraps.add(f)
- from enumdata import language_list, country_list, script_list
- language = dict((v, k) for k, v in language_list.values() if not v.isspace())
- country = dict((v, k) for k, v in country_list.values() if v != 'ZZ')
- script = dict((v, k) for k, v in script_list.values() if v != 'Zzzz')
+ from enumdata import language_map, country_map, script_map
+ language = dict((v, k) for k, v in language_map.values() if not v.isspace())
+ country = dict((v, k) for k, v in country_map.values() if v != 'ZZ')
+ script = dict((v, k) for k, v in script_map.values() if v != 'Zzzz')
lang = dict(self.__checkEnum(language, self.__codeMap('language'), scraps))
land = dict(self.__checkEnum(country, self.__codeMap('country'), scraps))
text = dict(self.__checkEnum(script, self.__codeMap('script'), scraps))
@@ -673,10 +673,10 @@ enumdata.py (keeping the old name as an alias):
# They're not actually lists: mappings from numeric value
# to pairs of full name and short code. What we want, in
# each case, is a mapping from code to the other two.
- from enumdata import language_list, script_list, country_list
- for form, book, empty in (('language', language_list, 'AnyLanguage'),
- ('script', script_list, 'AnyScript'),
- ('country', country_list, 'AnyTerritory')):
+ from enumdata import language_map, script_map, country_map
+ for form, book, empty in (('language', language_map, 'AnyLanguage'),
+ ('script', script_map, 'AnyScript'),
+ ('country', country_map, 'AnyTerritory')):
cache[form] = dict((pair[1], (num, pair[0]))
for num, pair in book.items() if pair[0] != 'C')
# (Have to filter out the C locale, as we give it the
diff --git a/util/locale_database/enumdata.py b/util/locale_database/enumdata.py
index 70589cfcf4..6e92347188 100644
--- a/util/locale_database/enumdata.py
+++ b/util/locale_database/enumdata.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8; -*-
#############################################################################
##
-## Copyright (C) 2020 The Qt Company Ltd.
+## Copyright (C) 2021 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of the Qt Toolkit.
@@ -52,7 +52,7 @@
# languages so closely related to one another that they could also be
# regarded as divergent dialects of the macrolanguage.
-language_list = {
+language_map = {
0: ("AnyLanguage", " "),
1: ("C", " "),
@@ -408,7 +408,7 @@ language_aliases = {
'Kirghiz': 'Kyrgyz'
}
-country_list = {
+country_map = {
0: ("AnyTerritory", "ZZ"),
1: ("Afghanistan", "AF"),
@@ -708,7 +708,7 @@ country_aliases = {
'TuvaluCountry': 'TuvaluTerritory',
}
-script_list = {
+script_map = {
0: ("AnyScript", "Zzzz"),
1: ("Adlam", "Adlm"),
diff --git a/util/locale_database/qlocalexml.py b/util/locale_database/qlocalexml.py
index a80d777907..d936dbeec3 100644
--- a/util/locale_database/qlocalexml.py
+++ b/util/locale_database/qlocalexml.py
@@ -334,10 +334,10 @@ class QLocaleXmlWriter (object):
# Output of various sections, in their usual order:
def enumData(self):
- from enumdata import language_list, script_list, country_list
- self.__enumTable('language', language_list)
- self.__enumTable('script', script_list)
- self.__enumTable('country', country_list)
+ from enumdata import language_map, script_map, country_map
+ self.__enumTable('language', language_map)
+ self.__enumTable('script', script_map)
+ self.__enumTable('country', country_map)
def likelySubTags(self, entries):
self.__openTag('likelySubtags')