git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[StGit PATCH 1/6] Allow caller to customize title of error/warning message

From
Karl Hasselström <kha@treskal.com>
Date
Oct 8, 2007, 08:55 UTC
Message-ID
<20071008085512.9734.33911.stgit@yoghurt>
In-Reply-To
<20071008085430.9734.75797.stgit@yoghurt>
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 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)
Previous: Karl HasselströmNext: Karl Hasselström
Message 2 of 12 in “Survive capital punishment”
  1. 0/6 Survive capital punishmentKarl Hasselström, Oct 8, 2007
  2. 1/6 Allow caller to customize title of error/warning messageKarl Hasselström, Oct 8, 2007
  3. 2/6 Use our nice message printout wrapping systemKarl Hasselström, Oct 8, 2007
  4. 3/6 Properly detect that HEAD is detachedKarl Hasselström, Oct 8, 2007
  5. 4/6 Refactor crt_series creationKarl Hasselström, Oct 8, 2007
  6. 5/6 Don't have a global crt_series in stgit.commans.commonKarl Hasselström, Oct 8, 2007
  7. 6/6 Let some commands work with detached HEADKarl Hasselström, Oct 8, 2007
  8. Karl HasselströmOct 8, 2007
  9. New test: "stg diff"Karl Hasselström, Oct 9, 2007
  10. Karl HasselströmOct 9, 2007
  11. Karl HasselströmOct 8, 2007
  12. Karl HasselströmOct 8, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.