(node, retVal=None)
| 183 | """ |
| 184 | |
| 185 | def iterate(node, retVal=None): |
| 186 | class DictObject(object): |
| 187 | def __init__(self): |
| 188 | self.__dict__ = {} |
| 189 | |
| 190 | def __contains__(self, name): |
| 191 | return name in self.__dict__ |
| 192 | |
| 193 | if retVal is None: |
| 194 | retVal = DictObject() |
| 195 | |
| 196 | for child in node.findall("*"): |
| 197 | instance = DictObject() |
| 198 | retVal.__dict__[child.tag] = instance |
| 199 | if child.attrib: |
| 200 | instance.__dict__.update(child.attrib) |
| 201 | else: |
| 202 | iterate(child, instance) |
| 203 | |
| 204 | return retVal |
| 205 | |
| 206 | tree = ElementTree() |
| 207 | try: |
no test coverage detected
searching dependent graphs…