From f28dcc2c7e417c90264fca7b611d4cb62b4dd909 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 8 Jul 2007 06:10:24 +0000 Subject: [PATCH] Add color classes PROMPT_CHOICE_{DEFAULT,OTHER} for emerge's Yes/No prompt. (trunk r7199) svn path=/main/branches/2.1.2/; revision=7200 --- bin/emerge | 6 +++++- man/color.map.5 | 6 ++++++ pym/output.py | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/bin/emerge b/bin/emerge index f10f56c95..4145b6b2a 100755 --- a/bin/emerge +++ b/bin/emerge @@ -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)] diff --git a/man/color.map.5 b/man/color.map.5 index 32c02f9cc..0cef66257 100644 --- a/man/color.map.5 +++ b/man/color.map.5 @@ -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 diff --git a/pym/output.py b/pym/output.py index ed95108fe..be01be000 100644 --- a/pym/output.py +++ b/pym/output.py @@ -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): """ -- 2.26.2