[gobject-introspection/wip/transformer] Various fixes



commit 07c4acb12ec7790672f0b83717639967d6ac2f5e
Author: Colin Walters <walters verbum org>
Date:   Thu Jul 22 21:07:59 2010 -0400

    Various fixes

 giscanner/glibtransformer.py |    1 -
 giscanner/transformer.py     |   20 ++++++++++++--------
 2 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/giscanner/glibtransformer.py b/giscanner/glibtransformer.py
index 0523cb1..fde6d8a 100644
--- a/giscanner/glibtransformer.py
+++ b/giscanner/glibtransformer.py
@@ -503,7 +503,6 @@ method or constructor of some type."""
         # functions and which are signal slots by
         # assuming everything that doesn't share a name
         # with a known signal is a virtual slot.
-        print "fields: %r" % (maybe_class.fields, )
         for field in maybe_class.fields:
             if not isinstance(field, Callback):
                 continue
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index dc918da..4ad2ef1 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -92,7 +92,8 @@ class Transformer(object):
                     positions.update(original.file_positions)
                     positions.update(node.file_positions)
                     self.log_warning("Namespace conflict for '%s'" % (node.name, ),
-                                     positions, fatal=True)
+                                     positions)
+                    sys.exit(1)
 
     def set_include_paths(self, paths):
         self._includepaths = list(paths)
@@ -141,6 +142,7 @@ If the warning is related to a Node type, see log_node_warning()."""
         else:
             target_file_positions = file_positions
 
+        position_strings = []
         for (filename, line, column) in target_file_positions:
             if filename.startswith(self._cwd):
                 filename = filename[len(self._cwd):]
@@ -150,14 +152,18 @@ If the warning is related to a Node type, see log_node_warning()."""
                 position = '%s:%d' % (filename, line, )
             else:
                 position = '%s:' % (filename, )
+            position_strings.append(position)
 
+        for position in position_strings[:-1]:
+            print >>sys.stderr, "%s:" % (position, )
+        last_position = position_strings[-1]
         if prefix:
             print >>sys.stderr, \
-'''%s: warning: ns=%r %s: %s''' % (position, self._namespace.name,
+'''%s: warning: ns=%r %s: %s''' % (last_position, self._namespace.name,
                                    prefix, text)
         else:
             print >>sys.stderr, \
-'''%s: warning: ns=%r: %s''' % (position, self._namespace.name, text)
+'''%s: warning: ns=%r: %s''' % (last_position, self._namespace.name, text)
         if fatal:
             sys.exit(1)
 
@@ -552,21 +558,19 @@ pair of (namespace, stripped_identifier) or raise ValueError."""
         struct = Record(name, symbol.ident, disguised)
         struct.add_symbol_reference(symbol)
         self._typedefs_ns[symbol.ident] = struct
-        self._create_struct(symbol)
-        return struct
+        return None
 
     def _create_typedef_union(self, symbol):
         name = self.remove_prefix(symbol.ident)
         union = Union(name, symbol.ident)
         union.add_symbol_reference(symbol)
         self._typedefs_ns[symbol.ident] = union
-        self._create_union(symbol)
-        return union
+        return None
 
     def _create_typedef_callback(self, symbol):
         callback = self._create_callback(symbol)
         self._typedefs_ns[callback.name] = callback
-        return callback
+        return None
 
     def _create_compound(self, klass, symbol, anonymous):
         if symbol.ident is None:



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