Add color classes PROMPT_CHOICE_{DEFAULT,OTHER} for emerge's Yes/No prompt. (trunk...
authorZac Medico <zmedico@gentoo.org>
Sun, 8 Jul 2007 06:10:24 +0000 (06:10 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 8 Jul 2007 06:10:24 +0000 (06:10 -0000)
svn path=/main/branches/2.1.2/; revision=7200

bin/emerge
man/color.map.5
pym/output.py

index f10f56c95bd6c2aec2eabafb117ba173af229493..4145b6b2a948bf9e73f4d16a973448a97f3f3f81 100755 (executable)
@@ -136,7 +136,11 @@ def userquery(prompt, responses=None, colours=None):
        KeyboardInterrupt is converted to SystemExit to avoid tracebacks being
        printed."""
        if responses is None:
-               responses, colours = ["Yes", "No"], [green, red]
+               responses = ["Yes", "No"]
+               colours = [
+                       create_color_func("PROMPT_CHOICE_DEFAULT"),
+                       create_color_func("PROMPT_CHOICE_OTHER")
+               ]
        elif colours is None:
                colours=[bold]
        colours=(colours*len(responses))[:len(responses)]
index 32c02f9cc276f2f44e0cc02f3aed6be8d127b968..0cef66257b62e1214815e9cacb3ea3cf8225ee12 100644 (file)
@@ -48,6 +48,12 @@ Defines color used for system packages not planned to be merged.
 \fBPKG_NOMERGE_WORLD\fR = \fI"blue"\fR
 Defines color used for world packages not planned to be merged.
 .TP
+\fBPROMPT_CHOICE_DEFAULT\fR = \fI"green"\fR
+Defines color used for the default choice at a prompt.
+.TP
+\fBPROMPT_CHOICE_OTHER\fR = \fI"red"\fR
+Defines color used for a non\-default choice at a prompt.
+.TP
 \fBSECURITY_WARN\fR = \fI"red"\fR
 Defines color used for security warnings.
 .TP
index ed95108fea8240efeaaf9924959955d04353b1f7..be01be0000d916b8abfe009cd374fd471fbb653b 100644 (file)
@@ -147,6 +147,8 @@ codes["PKG_MERGE_WORLD"]         = codes["green"]
 codes["PKG_NOMERGE"]             = codes["darkblue"]
 codes["PKG_NOMERGE_SYSTEM"]      = codes["darkblue"]
 codes["PKG_NOMERGE_WORLD"]       = codes["blue"]
+codes["PROMPT_CHOICE_DEFAULT"]   = codes["green"]
+codes["PROMPT_CHOICE_OTHER"]     = codes["red"]
 
 def parse_color_map(onerror=None):
        """