diff options
author | Colin Walters <walters@verbum.org> | 2010-10-07 16:27:00 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2010-10-25 17:04:53 -0400 |
commit | b18c248d2fcb7accc96269341e87eca5cb3ad864 (patch) | |
tree | 0afdfa3a33fbc3ab3f772fba638db67c9f7f0bca /giscanner/message.py | |
parent | a09298e2638282e8529c554704a2493006af379f (diff) | |
download | gobject-introspection-b18c248d2fcb7accc96269341e87eca5cb3ad864.tar.gz |
scanner: Print out a message if warnings were off
Otherwise people may not know about --warn-all.
https://bugzilla.gnome.org/show_bug.cgi?id=631644
Diffstat (limited to 'giscanner/message.py')
-rw-r--r-- | giscanner/message.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/giscanner/message.py b/giscanner/message.py index ec7ace00..1b0e260c 100644 --- a/giscanner/message.py +++ b/giscanner/message.py @@ -74,7 +74,7 @@ class MessageLogger(object): self._output = output self._namespace = namespace self._enable_warnings = False - self._warned = False + self._warning_count = 0 @classmethod def get(cls, *args, **kwargs): @@ -85,21 +85,21 @@ class MessageLogger(object): def enable_warnings(self, enable): self._enable_warnings = enable - def did_warn(self): - return self._warned + def get_warning_count(self): + return self._warning_count def log(self, log_type, text, positions=None, prefix=None): """Log a warning, using optional file positioning information. If the warning is related to a ast.Node type, see log_node_warning().""" utils.break_on_debug_flag('warning') + self._warning_count += 1 + if not self._enable_warnings: if log_type == FATAL: raise SystemExit(text) return - self._warned = True - if type(positions) == set: positions = list(positions) if isinstance(positions, Position): |