Closed rsalevsky closed 9 years ago
xmlformat.pl should help there. (Just as suggestion if you don't have any solution yet)
@mschnitzer There is already a pretty print option inside the lxml library. :-)
@tomschr as you can see, I'm not the "Python-Guy" :P
I think, this can be done with the .tail
property. If you set it to \n
you'll get a linebreak. However, it is a little bit more difficult to get the indentation right.
One possible algorithm:
info
variable).info.getprevious().tail.rsplit('\n')[-1]
to the get the indentation of the <info>
element.<docmanager>
element(s).Should I implement that?
@mschnitzer Yes, please! :-)
Having all of DocManager's elements in one line is inconvenient: it makes diffs almost useless and it is hard to read.
As such, we need to separate all the child elements from the <docmanager>
element. Each property should rest on a separate line. To make it simpler, try to separate the (child) elements and pretty print them later.
@tomschr I assigned you to this bug because you already opened a new issue fix branch.
Just for the sake of completness: I've took a different approach. Add all children to the <docmanager>
element, reformat them, and then write the result to the file.
@tomschr your branch is still in the branch list. Can you please merge it? https://github.com/openSUSE/docmanager/tree/feature/issue1
Branch already merged in commit 6156ca7, branch deleted now.
Every element which is created or edited by docmanager is in one line. So it is needed to add a line break after the elements to keep the legibility.