diff options
Diffstat (limited to 'python/introspect_parser.py')
-rw-r--r-- | python/introspect_parser.py | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/python/introspect_parser.py b/python/introspect_parser.py index 40cae1e7..47c9806e 100644 --- a/python/introspect_parser.py +++ b/python/introspect_parser.py @@ -13,35 +13,36 @@ def process_introspection_data(data): reader = input_source.newTextReader("urn:introspect") ret = reader.Read() - current_iface='' - current_method='' + current_iface = None + current_method = None current_sigstr = '' - + while ret == 1: name = reader.LocalName() if reader.NodeType() == XMLREADER_START_ELEMENT_NODE_TYPE: - if name == 'interface': + if (not current_iface and not current_method and name == 'interface'): current_iface = reader.GetAttribute('name') - elif name == 'method': + elif (current_iface and not current_method and name == 'method'): current_method = reader.GetAttribute('name') if reader.IsEmptyElement(): - method_map[current_iface + '.' + current_method] = '' - current_method = '' + method_map[current_iface + '.' + current_method] = '' + current_method = None current_sigstr = '' - - elif name == 'arg': + + elif (current_iface and current_method and name == 'arg'): direction = reader.GetAttribute('direction') if not direction or direction == 'in': current_sigstr = current_sigstr + reader.GetAttribute('type') elif reader.NodeType() == XMLREADER_END_ELEMENT_NODE_TYPE: - if name == 'method': - method_map[current_iface + '.' + current_method] = current_sigstr - current_method = '' + if (current_iface and not current_method and name == 'interface'): + current_iface = None + if (current_iface and current_method and name == 'method'): + method_map[current_iface + '.' + current_method] = current_sigstr + current_method = None current_sigstr = '' - ret = reader.Read() if ret != 0: |