summaryrefslogtreecommitdiff
path: root/giscanner/girparser.py
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-06-17 10:38:39 -0400
committerColin Walters <walters@verbum.org>2010-06-17 10:49:41 -0400
commit7b4af5e3bd9081e5ff72d9439bb868017dd8c2c8 (patch)
treeb24d72c5d8bf36c5e8fd20d666fe6da657401774 /giscanner/girparser.py
parentb683ef027b2d96c7cd6c7f895a0437a03567dc05 (diff)
downloadgobject-introspection-7b4af5e3bd9081e5ff72d9439bb868017dd8c2c8.tar.gz
More explicitly document how we'll use the version= attribute on repository
I want to start bumping it on incompatible .gir changes. https://bugzilla.gnome.org/show_bug.cgi?id=621895
Diffstat (limited to 'giscanner/girparser.py')
-rw-r--r--giscanner/girparser.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/giscanner/girparser.py b/giscanner/girparser.py
index 852874d9..57db0fb6 100644
--- a/giscanner/girparser.py
+++ b/giscanner/girparser.py
@@ -27,6 +27,8 @@ from .glibast import (GLibEnum, GLibEnumMember, GLibFlags,
GLibInterface, GLibObject, GLibBoxedStruct,
GLibBoxedUnion, GLibBoxedOther)
+from .girwriter import COMPATIBLE_GIR_VERSION
+
CORE_NS = "http://www.gtk.org/introspection/core/1.0"
C_NS = "http://www.gtk.org/introspection/c/1.0"
GLIB_NS = "http://www.gtk.org/introspection/glib/1.0"
@@ -93,6 +95,11 @@ class GIRParser(object):
def _parse_api(self, root):
assert root.tag == _corens('repository')
+ version = root.attrib['version']
+ if version != COMPATIBLE_GIR_VERSION:
+ raise ValueError("Incompatible version %s (supported: %s)",
+ version, COMPATIBLE_GIR_VERSION)
+
for node in root.getchildren():
if node.tag == _corens('include'):
self._parse_include(node)