Write element tree or element structure to sys.stdout. This function should be used for debugging only. *elem* is either an ElementTree, or a single Element. The exact output format is implementation dependent. In this version, it's written as an ordinary XML file.
(elem)
| 1129 | |
| 1130 | |
| 1131 | def dump(elem): |
| 1132 | """Write element tree or element structure to sys.stdout. |
| 1133 | |
| 1134 | This function should be used for debugging only. |
| 1135 | |
| 1136 | *elem* is either an ElementTree, or a single Element. The exact output |
| 1137 | format is implementation dependent. In this version, it's written as an |
| 1138 | ordinary XML file. |
| 1139 | |
| 1140 | """ |
| 1141 | # debugging |
| 1142 | if not isinstance(elem, ElementTree): |
| 1143 | elem = ElementTree(elem) |
| 1144 | elem.write(sys.stdout, encoding="unicode") |
| 1145 | tail = elem.getroot().tail |
| 1146 | if not tail or tail[-1] != "\n": |
| 1147 | sys.stdout.write("\n") |
| 1148 | |
| 1149 | |
| 1150 | def indent(tree, space=" ", level=0): |
no test coverage detected
searching dependent graphs…