File: debug.py

package info (click to toggle)
python-caldav 1.3.9-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 636 kB
  • sloc: python: 6,824; makefile: 91; sh: 7
file content (11 lines) | stat: -rw-r--r-- 231 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
from lxml import etree


def xmlstring(root):
    if hasattr(root, "xmlelement"):
        root = root.xmlelement()
    return etree.tostring(root, pretty_print=True).decode("utf-8")


def printxml(root):
    print(xmlstring(root))