From: Karl Hasselström Date: Mon, 08 Oct 2007 08:55:12 GMT Subject: [StGit PATCH 1/6] Allow caller to customize title of error/warning message Message-ID: <20071008085512.9734.33911.stgit@yoghurt> In-Reply-To: <20071008085430.9734.75797.stgit@yoghurt> Signed-off-by: Karl Hasselström --- stgit/out.py | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) 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)