From cfc80488d1b3ceec939a29951b017cae26a31ab6 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 28 Oct 2024 18:12:42 +0100 Subject: [PATCH] Simplify QLocaleXmlWriter.__openTag() The other methods that open a tag, potentially with attributes, all now share __attrJoin() as the tool to combine the attributes and the tag. Do the same in __openTag(). Change-Id: Ib252b5901b9e1459cbb8c5706ff56f1b7b639d3d Reviewed-by: Mate Barany --- util/locale_database/qlocalexml.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/util/locale_database/qlocalexml.py b/util/locale_database/qlocalexml.py index 6d1a167fd52..6eab4454577 100644 --- a/util/locale_database/qlocalexml.py +++ b/util/locale_database/qlocalexml.py @@ -840,10 +840,8 @@ class QLocaleXmlWriter (object): self.__closeTag('zoneForms') def __openTag(self, tag, **attrs): - if attrs: - text = ' '.join(f'{k}="{v}"' for k, v in attrs.items()) - tag = f'{tag} {text}' - self.__write(f'<{tag}>') + self.__write(f'<{self.__attrJoin(tag, attrs)}>') + def __closeTag(self, tag): self.__write(f'')