[gobject-introspection] scanner: Bomb out more obviously if a namespace contains class name = namespace



commit 3236f2c4bb6e58f64f48b10f2b826b86c30aad16
Author: Colin Walters <walters verbum org>
Date:   Mon Sep 13 14:44:21 2010 -0400

    scanner: Bomb out more obviously if a namespace contains class name = namespace
    
    If you pass --namespace=FooBar, and have a GObject named FooBar, we'd
    assert.  Give the user an obvious error message.

 giscanner/gdumpparser.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py
index 7960e97..ea5794e 100644
--- a/giscanner/gdumpparser.py
+++ b/giscanner/gdumpparser.py
@@ -279,6 +279,12 @@ blob containing data gleaned from GObject's primitive introspection."""
         get_type = xmlnode.attrib['get-type']
         (ns, name) = self._transformer.split_csymbol(get_type)
         assert ns is self._namespace
+        if name == 'get_type':
+            message.fatal("""The GObject name %r isn't compatibile
+with the configured identifier prefixes:
+  %r
+The class would have no name.  Most likely you want to specify a
+different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.identifier_prefixes))
         assert name.endswith('_get_type')
         return (get_type, name[:-len('_get_type')])
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]