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 <mate.barany@qt.io>
This commit is contained in:
parent
6ddf74716d
commit
cfc80488d1
@ -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}>')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user