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 <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 37c5a9f20b9973a0f29c05965e243622f5596da0)
This commit is contained in:
Edward Welbourne 2023-07-27 18:57:40 +02:00
parent a8c5512798
commit a5756053b3

View File

@ -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('</localeDatabase>')
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):