From 9c8df2214790f7141a9bdb20efa656f0fe0f94e6 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 3 Jun 2024 17:11:47 +0200 Subject: [PATCH] QLocaleXml: use tabs for indentation One character instead of four adds up to a lot of saved bytes when a file has many lines: and the timezone name L10n data is going to add a lot of lines. Task-number: QTBUG-115158 Change-Id: I856f3771266a70b7a9ef4078a9b4aecf42315831 Reviewed-by: Mate Barany --- util/locale_database/qlocalexml.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/util/locale_database/qlocalexml.py b/util/locale_database/qlocalexml.py index 8d5f653948d..f90684e4817 100644 --- a/util/locale_database/qlocalexml.py +++ b/util/locale_database/qlocalexml.py @@ -296,7 +296,7 @@ class QLocaleXmlWriter (object): The output saved by this should conform to qlocalexml.rnc's schema.""" - def __init__(self, cldrVersion, save = None, space = Spacer(4)): + def __init__(self, cldrVersion, save = None, space = Spacer('\t')): """Set up to write digested CLDR data as QLocale XML. First argument is the version of CLDR whose data we'll be @@ -310,13 +310,15 @@ class QLocaleXmlWriter (object): Third argument, space, is an object to call on each text output to prepend indentation and append newlines, or not as the case may be. The - default is a Spacer(4), which grows indent by four spaces after each + default is a Spacer('\t'), which grows indent by a tab after each unmatched new tag and shrinks back on a close-tag (its parsing is naive, but adequate to how this class uses it), while adding a newline to each line.""" self.__rawOutput = self.__printit if save is None else save self.__wrap = space - self.__write('') + self.__write('' + # A hint to emacs to make display nicer: + '') self.__openTag('localeDatabase', versionCldr = cldrVersion, versionQt = qtVersion)