summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-07-28 09:32:28 -0300
committerJohan Dahlin <johan@gnome.org>2010-07-28 09:32:28 -0300
commit11fb7c9798c94ba8355fcc9ee4097dc5d2462f05 (patch)
treef4982a08c9b5fe337780c3cb118d40237ccb1c31
parentcbdd9ee09e367e4dd76d6d8a9a20bf714f794c20 (diff)
downloadgobject-introspection-11fb7c9798c94ba8355fcc9ee4097dc5d2462f05.tar.gz
[giscanner] Make warnings less dense
Omit ns=, context= and include the function symbol for Functions
-rw-r--r--giscanner/transformer.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index 319e43cb..2f255211 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -147,11 +147,11 @@ If the warning is related to a Node type, see log_node_warning()."""
if prefix:
print >>sys.stderr, \
-'''%s: warning: ns=%r %s: %s''' % (position, self._namespace.name,
- prefix, text)
+'''%s: warning: %s: %s: %s''' % (position, self._namespace.name,
+ prefix, text)
else:
print >>sys.stderr, \
-'''%s: warning: ns=%r: %s''' % (position, self._namespace.name, text)
+'''%s: warning: %s: %s''' % (position, self._namespace.name, text)
def log_symbol_warning(self, symbol, text):
"""Log a warning in the context of the given symbol."""
@@ -172,7 +172,11 @@ context will be used."""
file_positions = node.file_positions
if context:
- text = "context=%r %s" % (context.name, text)
+ if isinstance(context, Function):
+ name = context.symbol
+ else:
+ name = context.name
+ text = "%s: %s" % (name, text)
self.log_warning(text, file_positions)