From a5756053b3463fe009e97e4fbf81eedeae5d277b Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 27 Jul 2023 18:57:40 +0200 Subject: [PATCH] Fix typos in QLocaleXmlWriter The script and territory to exclude from reports about unused ones were swapped, so we excluded a territory from the script list (which didn't contain it anyway) and vice versa. The test for whether to report used the non-existent .territories attribute by mistake for .__territories Change-Id: I29e9d9f8f34883d7c3a5ac15470d9e7a0366e3db Reviewed-by: Ievgenii Meshcheriakov (cherry picked from commit 37c5a9f20b9973a0f29c05965e243622f5596da0) --- util/locale_database/qlocalexml.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/locale_database/qlocalexml.py b/util/locale_database/qlocalexml.py index a3e2fb9d2b6..e63e8d4c98b 100644 --- a/util/locale_database/qlocalexml.py +++ b/util/locale_database/qlocalexml.py @@ -324,9 +324,9 @@ class QLocaleXmlWriter (object): self.__languages = set(p[1] for p in language_map.values() if not p[1].isspace()) self.__scripts = set(p[1] for p in script_map.values() - if p[1] != 'ZZ') + if p[1] != 'Zzzz') self.__territories = set(p[1] for p in territory_map.values() - if p[1] != 'Zzzz') + if p[1] != 'ZZ') def likelySubTags(self, entries): self.__openTag('likelySubtags') @@ -360,7 +360,7 @@ class QLocaleXmlWriter (object): self.__write('') self.__rawOutput = self.__complain - if self.__languages or self.__scripts or self.territories: + if self.__languages or self.__scripts or self.__territories: grumble('Some enum members are unused, corresponding to these tags:\n') import textwrap def kvetch(kind, seq, g = grumble, w = textwrap.wrap):