mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-27 10:16:14 +01:00
Fix core.xmlindent() to work with ElementTree objects
This commit is contained in:
parent
ba1b3c791b
commit
c8f2ae1ae6
@ -636,6 +636,8 @@ class DirectoryServiceinfo:
|
|||||||
|
|
||||||
def xmlindent(elem, level=0):
|
def xmlindent(elem, level=0):
|
||||||
i = "\n" + level * " "
|
i = "\n" + level * " "
|
||||||
|
if isinstance(elem, ET.ElementTree):
|
||||||
|
elem = elem.getroot()
|
||||||
if len(elem):
|
if len(elem):
|
||||||
if not elem.text or not elem.text.strip():
|
if not elem.text or not elem.text.strip():
|
||||||
elem.text = i + " "
|
elem.text = i + " "
|
||||||
|
Loading…
Reference in New Issue
Block a user