From 181424d9b57512ffcc8b1589351683899bf7febe Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 4 May 2021 11:14:30 +0200 Subject: [PATCH] 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 --- util/locale_database/cldr2qlocalexml.py | 5 ++--- util/locale_database/qlocalexml.py | 11 ++++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/util/locale_database/cldr2qlocalexml.py b/util/locale_database/cldr2qlocalexml.py index 20dda779650..9d910c2b8d2 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 4fcfe32a43c..a80d7779073 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('') # 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')