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>
This commit is contained in:
parent
451500f8f8
commit
181424d9b5
@ -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)
|
||||
|
||||
|
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user