From: Karl Hasselström Date: Mon, 8 Oct 2007 05:25:06 +0000 (+0200) Subject: Allow caller to customize title of error/warning message X-Git-Tag: v0.14.3~79 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/20d80b857125496f334600c84fd66b4e2e13e9a0 Allow caller to customize title of error/warning message Signed-off-by: Karl Hasselström --- diff --git a/stgit/out.py b/stgit/out.py index 3464175..d3c86b4 100644 --- a/stgit/out.py +++ b/stgit/out.py @@ -85,12 +85,12 @@ class MessagePrinter(object): def info(self, *msgs): for msg in msgs: self.__out.single_line(msg) - def note(self, *msgs): - self.__out.tagged_lines('Notice', msgs) - def warn(self, *msgs): - self.__err.tagged_lines('Warning', msgs) - def error(self, *msgs): - self.__err.tagged_lines('Error', msgs) + def note(self, *msgs, **kw): + self.__out.tagged_lines(kw.get('title', 'Notice'), msgs) + def warn(self, *msgs, **kw): + self.__err.tagged_lines(kw.get('title', 'Warning'), msgs) + def error(self, *msgs, **kw): + self.__err.tagged_lines(kw.get('title', 'Error'), msgs) def start(self, msg): """Start a long-running operation.""" self.__out.single_line('%s ... ' % msg, print_newline = False)