mirror of
https://github.com/Ircama/epson_print_conf.git
synced 2025-05-14 07:04:41 -04:00
Refinements
This commit is contained in:
parent
fcd0c41076
commit
64d7a915c2
1 changed files with 9 additions and 6 deletions
|
@ -27,12 +27,15 @@ def text_to_dict(text):
|
||||||
|
|
||||||
def traverse_data(element, depth=0):
|
def traverse_data(element, depth=0):
|
||||||
indent = ' ' * depth
|
indent = ' ' * depth
|
||||||
if element.tag:
|
if element.tag and not element.attrib and element.text and element.text.strip():
|
||||||
print(indent + element.tag)
|
print(indent + element.tag + " = " + element.text)
|
||||||
if element.attrib:
|
else:
|
||||||
print(indent + ' Attributes:', element.attrib)
|
if element.tag:
|
||||||
if element.text and element.text.strip():
|
print(indent + element.tag + ":")
|
||||||
print(indent + ' Text:', element.text.strip())
|
if element.attrib:
|
||||||
|
print(indent + ' Attributes:', element.attrib)
|
||||||
|
if element.text and element.text.strip():
|
||||||
|
print(indent + ' Text:', element.text.strip())
|
||||||
|
|
||||||
# Recursively traverse the children
|
# Recursively traverse the children
|
||||||
for child in element:
|
for child in element:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue