Mercurial > libervia-backend
diff sat_frontends/tools/xmltools.py @ 2624:56f94936df1e
code style reformatting using black
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 27 Jun 2018 20:14:46 +0200 |
parents | 26edcf3a30eb |
children | 003b8b4b56a7 |
line wrap: on
line diff
--- a/sat_frontends/tools/xmltools.py Wed Jun 27 07:51:29 2018 +0200 +++ b/sat_frontends/tools/xmltools.py Wed Jun 27 20:14:46 2018 +0200 @@ -29,20 +29,19 @@ @return: plain XML """ root_elt = doc.documentElement - if root_elt.hasAttribute('style'): - styles_raw = root_elt.getAttribute('style') - styles = styles_raw.split(';') + if root_elt.hasAttribute("style"): + styles_raw = root_elt.getAttribute("style") + styles = styles_raw.split(";") new_styles = [] for style in styles: try: - key, value = style.split(':') + key, value = style.split(":") except ValueError: continue - if key.strip().lower() == 'display': - value = 'inline' - new_styles.append('%s: %s' % (key.strip(), value.strip())) - root_elt.setAttribute('style', "; ".join(new_styles)) + if key.strip().lower() == "display": + value = "inline" + new_styles.append("%s: %s" % (key.strip(), value.strip())) + root_elt.setAttribute("style", "; ".join(new_styles)) else: - root_elt.setAttribute('style', 'display: inline') + root_elt.setAttribute("style", "display: inline") return root_elt.toxml() -