From 20d80b857125496f334600c84fd66b4e2e13e9a0 Mon Sep 17 00:00:00 2001 Message-Id: <20d80b857125496f334600c84fd66b4e2e13e9a0.1715173744.git.mdw@distorted.org.uk> From: Mark Wooding Date: Mon, 8 Oct 2007 07:25:06 +0200 Subject: [PATCH] Allow caller to customize title of error/warning message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Organization: Straylight/Edgeware From: Karl Hasselström Signed-off-by: Karl Hasselström --- stgit/out.py | 12 ++++++------ 1 file 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) -- [mdw]