return
if node.tag != 'struct' and node.tag != 'group':
return
- for c in node.getchildren():
+ for c in node:
add_struct_refs(items, c)
for a in attribs:
if a in node.attrib:
f.write(' {0}="{1}"'.format(a, node.attrib[a]))
- children = node.getchildren()
+ children = list(node)
if len(children) > 0:
f.write('>\n')
for c in children:
enum_dict = {}
for e in enums:
values = e.findall('./value')
- e[:] = sorted(e.getchildren(), key=get_value)
+ e[:] = sorted(e, key=get_value)
enum_dict[e.attrib['name']] = e
# Structs are a bit annoying because they can refer to each other. We sort
structs = sorted(xml.findall('./struct'), key=get_name)
wrapped_struct_dict = {}
for s in structs:
- s[:] = sorted(s.getchildren(), key=get_start)
+ s[:] = sorted(s, key=get_start)
ws = Struct(s)
wrapped_struct_dict[ws.name] = ws
instructions = sorted(xml.findall('./instruction'), key=get_name)
for i in instructions:
- i[:] = sorted(i.getchildren(), key=get_start)
+ i[:] = sorted(i, key=get_start)
registers = sorted(xml.findall('./register'), key=get_name)
for r in registers:
- r[:] = sorted(r.getchildren(), key=get_start)
+ r[:] = sorted(r, key=get_start)
genxml[:] = enums + list(sorted_structs.values()) + instructions + registers