summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-05-04 11:14:30 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2021-05-26 18:00:01 +0200
commit181424d9b57512ffcc8b1589351683899bf7febe (patch)
tree15a0b7bce46c3cf29753aa043c2f4a4adac82e03 /util
parent451500f8f81b562d65208141785e3b2077768576 (diff)
QLocaleXmlWriter.enumData(): move enumdata import to method from caller
The only reason cldr.py imported enumdata was so as to pass what it imported to writer.enumData(); that method might as well do the import itself. Change-Id: Ie77dcd29058f926b8cca4deef35837f30505859f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-xutil/locale_database/cldr2qlocalexml.py5
-rw-r--r--util/locale_database/qlocalexml.py11
2 files changed, 8 insertions, 8 deletions
diff --git a/util/locale_database/cldr2qlocalexml.py b/util/locale_database/cldr2qlocalexml.py
index 20dda77965..9d910c2b8d 100755
--- a/util/locale_database/cldr2qlocalexml.py
+++ b/util/locale_database/cldr2qlocalexml.py
@@ -2,7 +2,7 @@
# coding=utf8
#############################################################################
##
-## 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.
@@ -59,7 +59,6 @@ import sys
from cldr import CldrReader
from qlocalexml import QLocaleXmlWriter
-from enumdata import language_list, script_list, country_list
def usage(name, err, message = ''):
err.write("""Usage: {} path/to/cldr/common/main [out-file.xml]
@@ -110,7 +109,7 @@ def main(args, out, err):
writer = QLocaleXmlWriter(emit.write)
writer.version(reader.root.cldrVersion)
- writer.enumData(language_list, script_list, country_list)
+ writer.enumData()
writer.likelySubTags(reader.likelySubTags())
writer.locales(reader.readLocales(calendars), calendars)
diff --git a/util/locale_database/qlocalexml.py b/util/locale_database/qlocalexml.py
index 4fcfe32a43..a80d777907 100644
--- a/util/locale_database/qlocalexml.py
+++ b/util/locale_database/qlocalexml.py
@@ -1,7 +1,7 @@
# coding=utf8
#############################################################################
##
-## 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.
@@ -333,10 +333,11 @@ class QLocaleXmlWriter (object):
self.__write('<localeDatabase>')
# Output of various sections, in their usual order:
- def enumData(self, languages, scripts, countries):
- self.__enumTable('language', languages)
- self.__enumTable('script', scripts)
- self.__enumTable('country', countries)
+ 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)
def likelySubTags(self, entries):
self.__openTag('likelySubtags')