diff options
-rw-r--r-- | giscanner/girparser.py | 20 | ||||
-rw-r--r-- | tests/scanner/Makefile.am | 2 |
2 files changed, 20 insertions, 2 deletions
diff --git a/giscanner/girparser.py b/giscanner/girparser.py index 40bc49e0..d258069a 100644 --- a/giscanner/girparser.py +++ b/giscanner/girparser.py @@ -24,6 +24,7 @@ from xml.etree.cElementTree import parse from . import ast from .girwriter import COMPATIBLE_GIR_VERSION +from .collections import OrderedDict CORE_NS = "http://www.gtk.org/introspection/core/1.0" C_NS = "http://www.gtk.org/introspection/c/1.0" @@ -165,9 +166,18 @@ class GIRParser(object): def _parse_generic_attribs(self, node, obj): assert isinstance(obj, ast.Annotated) + skip = node.attrib.get('skip') + if skip: + try: + obj.skip = int(skip) > 0 + except ValueError: + obj.skip = False introspectable = node.attrib.get('introspectable') if introspectable: - obj.introspectable = int(introspectable) > 0 + try: + obj.introspectable = int(introspectable) > 0 + except ValueError: + obj.introspectable = False if self._types_only: return doc = node.find(_corens('doc')) @@ -195,6 +205,14 @@ class GIRParser(object): if stability_doc is not None: if stability_doc.text: obj.stability_doc = stability_doc.text + attributes = node.findall(_corens('attribute')) + if attributes: + attributes_ = OrderedDict() + for attribute in attributes: + name = attribute.attrib.get('name') + value = attribute.attrib.get('value') + attributes_[name] = value + obj.attributes = attributes_ def _parse_object_interface(self, node): parent = node.attrib.get('parent') diff --git a/tests/scanner/Makefile.am b/tests/scanner/Makefile.am index 92ab12a3..c7a1b32c 100644 --- a/tests/scanner/Makefile.am +++ b/tests/scanner/Makefile.am @@ -5,7 +5,7 @@ include $(top_srcdir)/Makefile.introspection SUBDIRS = . annotationparser -INTROSPECTION_SCANNER_ARGS += --warn-all +INTROSPECTION_SCANNER_ARGS += --warn-all --reparse-validate CLEANFILES = |