[gobject-introspection] scanner: Deprecate using identifier prefixes in GINames



commit 08e6f9308fed377f2dcfcdf726e82066ca1fa8ea
Author: Colin Walters <walters verbum org>
Date:   Sat Oct 20 21:10:45 2012 +0200

    scanner: Deprecate using identifier prefixes in GINames
    
    Instead of crashing.  For more details, see the attached bug.
    
    Based on a patch by Stef Walter <stefw gnome org>.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684370

 giscanner/transformer.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index 6afad88..dfd2550 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -151,11 +151,15 @@ namespaces."""
         if '.' not in name:
             return self._namespace.get(name)
         else:
-            (ns, name) = name.split('.', 1)
+            (ns, giname) = name.split('.', 1)
             if ns == self._namespace.name:
-                return self._namespace.get(name)
+                return self._namespace.get(giname)
+            if ns in self._namespace.identifier_prefixes:
+                message.warn(("Deprecated reference to identifier " +
+                              "prefix %s in GIName %s") % (ns, name))
+                return self._namespace.get(giname)
             include = self._includes[ns]
-            return include.get(name)
+            return include.get(giname)
 
     def lookup_typenode(self, typeobj):
         """Given a Type object, if it points to a giname,



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