(self, root)
Add linebreaks to ElementTree root object.
Add linebreaks to ElementTree root object.
Add linebreaks to ElementTree root object .
def run(self, root):
        """ Add linebreaks to ElementTree root object. """

        self._prettifyETree(root)
        # Do <br />'s seperately as they are often in the middle of
        # inline content and missed by _prettifyETree.
        brs = root.getiterator('br')
        for br in brs:
            if not br.tail or not br.tail.strip():
                br.tail = '\n'
            else:
                br.tail = '\n%s' % br.tail
def run ( self , root ) : self . _prettifyETree ( root ) # Do <br />'s seperately as they are often in the middle of # inline content and missed by _prettifyETree. brs = root . getiterator ( 'br' ) for br in brs : if not br . tail or not br . tail . strip ( ) : br . tail = '\n' else : br . tail = '\n%s' % br . tail