Returns the value of XML element with the given name.
(elem, name)
| 62 | |
| 63 | |
| 64 | def get_elem_value(elem, name): |
| 65 | """Returns the value of XML element with the given name.""" |
| 66 | for child in elem: |
| 67 | if child.attrib.get("name") != name: |
| 68 | continue |
| 69 | if child.tag == "string": |
| 70 | return child.attrib.get("value") |
| 71 | if child.tag == "boolean": |
| 72 | return child.attrib.get("value") == "true" |
| 73 | if child.tag == "list": |
| 74 | return [nested_child.attrib.get("value") for nested_child in child] |
| 75 | raise "Cannot recognize tag: " + child.tag |
| 76 | return None |
| 77 | |
| 78 | |
| 79 | def normalize_paths(paths): |