diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-07-08 06:07:23 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-07-08 06:07:23 +0000 |
commit | 41ccdc0ab3efce184ab6d7a0f49a490c8fda21f9 (patch) | |
tree | a13e0e67303921d690d60ffc08d07c0b3f6c4124 | |
parent | d3a3b04bacbf42d945820adb1b5005bff59b02f2 (diff) | |
download | portage-41ccdc0ab3efce184ab6d7a0f49a490c8fda21f9.tar.gz portage-41ccdc0ab3efce184ab6d7a0f49a490c8fda21f9.tar.bz2 portage-41ccdc0ab3efce184ab6d7a0f49a490c8fda21f9.zip |
Add color classes PROMPT_CHOICE_{DEFAULT,OTHER} for emerge's Yes/No prompt.
svn path=/main/trunk/; revision=7199
-rw-r--r-- | man/color.map.5 | 6 | ||||
-rw-r--r-- | pym/emerge/__init__.py | 6 | ||||
-rw-r--r-- | pym/portage/output.py | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/man/color.map.5 b/man/color.map.5 index f1ace1c25..7a0f1b2ec 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/emerge/__init__.py b/pym/emerge/__init__.py index e48e6c085..cbecf9b22 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -135,7 +135,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/pym/portage/output.py b/pym/portage/output.py index 1dd45866d..e390b8807 100644 --- a/pym/portage/output.py +++ b/pym/portage/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): """ |