diff options
author | Edward Welbourne <[email protected]> | 2024-10-28 18:12:42 +0100 |
---|---|---|
committer | Edward Welbourne <[email protected]> | 2024-11-04 19:29:49 +0100 |
commit | cfc80488d1b3ceec939a29951b017cae26a31ab6 (patch) | |
tree | d317d5743dd857c25b20397ef9eae047f5e11913 | |
parent | 6ddf74716d7b2fe0df5dd9c0172f9ecf936d5c5d (diff) |
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 <[email protected]>
-rw-r--r-- | util/locale_database/qlocalexml.py | 6 |
1 files 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'</{tag}>') |