From 36f13a81f93d1d5bf055f78acc2be9f3b70bf122 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 6 Jul 2007 21:26:14 +0000 Subject: [PATCH] Misc color fixes. Thanks to Arfrever Frehtes Taifersar Arahesis for this patch from bug#183861, comment #9. (trunk r7183) svn path=/main/branches/2.1.2/; revision=7184 --- bin/emerge | 14 +++--- man/color.map.5 | 122 ++++++++++++++++++++++++++++++++++++++---------- pym/output.py | 24 +++++----- 3 files changed, 116 insertions(+), 44 deletions(-) diff --git a/bin/emerge b/bin/emerge index 412028e70..011b0469a 100755 --- a/bin/emerge +++ b/bin/emerge @@ -695,7 +695,7 @@ def create_world_atom(pkg_key, metadata, args_set, sets, portdb): atom will be returned. Atoms that are in the system set may also be stored in world since system atoms can only match one slot while world atoms can be greedy with respect to slots. Unslotted system packages will not be - not be stored in world.""" + stored in world.""" arg_atom = args_set.findAtomForPackage(pkg_key, metadata) cp = portage.dep_getkey(arg_atom) new_world_atom = cp @@ -3007,17 +3007,17 @@ class depgraph: def pkgprint(pkg): if pkg_merge: - if pkg_world: - return colorize("PKG_MERGE_WORLD", pkg) - elif pkg_system: + if pkg_system: return colorize("PKG_MERGE_SYSTEM", pkg) + elif pkg_world: + return colorize("PKG_MERGE_WORLD", pkg) else: return colorize("PKG_MERGE", pkg) else: - if pkg_world: - return colorize("PKG_NOMERGE_WORLD", pkg) - elif pkg_system: + if pkg_system: return colorize("PKG_NOMERGE_SYSTEM", pkg) + elif pkg_world: + return colorize("PKG_NOMERGE_WORLD", pkg) else: return colorize("PKG_NOMERGE", pkg) diff --git a/man/color.map.5 b/man/color.map.5 index 7f4cfde0b..32c02f9cc 100644 --- a/man/color.map.5 +++ b/man/color.map.5 @@ -1,4 +1,4 @@ -.TH "COLOR.MAP" "5" "Jun 2007" "Portage 2.1.3" "Portage" +.TH "COLOR.MAP" "5" "Jul 2007" "Portage 2.1.3" "Portage" .SH "NAME" color.map \- custom color settings for Portage .SH "SYNOPSIS" @@ -8,56 +8,127 @@ This file contains variables that define color classes used by Portage. Portage will check this file first for color classes settings. If no setting of given color class is found in /etc/portage/color.map, Portage uses default value defined internally. +.SH "SYNTAX" +\fBVARIABLE\fR = \fI[space delimited list of attributes]\fR .SH "VARIABLES" .TP -\fBBAD\fR = \fI"0xFF5555"\fR +\fBBAD\fR = \fI"red"\fR Defines color used for some words occuring in bad context. .TP -\fBBRACKET\fR = \fI"0x5555FF"\fR +\fBBRACKET\fR = \fI"blue"\fR Defines color used for brackets. .TP -\fBGOOD\fR = \fI"0x55FF55"\fR +\fBGOOD\fR = \fI"green"\fR Defines color used for some words occuring in good context. .TP -\fBHILITE\fR = \fI"0x00AAAA"\fR +\fBHILITE\fR = \fI"teal"\fR Defines color used for highlighted words. .TP -\fBINFORM\fR = \fI"0x00AA00"\fR +\fBINFORM\fR = \fI"darkgreen"\fR Defines color used for informational words. .TP -\fBMERGE_LIST_PROGRESS\fR = \fI"0xFFFF55"\fR -Defines color used for numbers used in merge progress lists. +\fBMERGE_LIST_PROGRESS\fR = \fI"yellow"\fR +Defines color used for numbers indicating merge progress. .TP -\fBPKG_MERGE\fR = \fI"0x00AA00"\fR +\fBPKG_MERGE\fR = \fI"darkgreen"\fR Defines color used for packages planned to be merged. .TP -\fBPKG_MERGE_SYSTEM\fR = \fI"0x00AA00"\fR -Defines color used for packages planned to be merged and belonging to -system set. +\fBPKG_MERGE_SYSTEM\fR = \fI"darkgreen"\fR +Defines color used for system packages planned to be merged. .TP -\fBPKG_MERGE_WORLD\fR = \fI"0x55FF55"\fR -Defines color used for packages planned to be merged and belonging to -world set. +\fBPKG_MERGE_WORLD\fR = \fI"green"\fR +Defines color used for world packages planned to be merged. .TP -\fBPKG_NOMERGE\fR = \fI"0x0000AA"\fR +\fBPKG_NOMERGE\fR = \fI"darkblue"\fR Defines color used for packages not planned to be merged. .TP -\fBPKG_NOMERGE_SYSTEM\fR = \fI"0x0000AA"\fR -Defines color used for packages not planned to be merged and belonging to -system set. +\fBPKG_NOMERGE_SYSTEM\fR = \fI"darkblue"\fR +Defines color used for system packages not planned to be merged. .TP -\fBPKG_NOMERGE_WORLD\fR = \fI"0x5555FF"\fR -Defines color used for packages not planned to be merged and belonging to -world set. +\fBPKG_NOMERGE_WORLD\fR = \fI"blue"\fR +Defines color used for world packages not planned to be merged. .TP -\fBSECURITY_WARN\fR = \fI"0xFF5555"\fR +\fBSECURITY_WARN\fR = \fI"red"\fR Defines color used for security warnings. .TP -\fBUNMERGE_WARN\fR = \fI"0xFF5555"\fR +\fBUNMERGE_WARN\fR = \fI"red"\fR Defines color used for unmerge warnings. .TP -\fBWARN\fR = \fI"0xFFFF55"\fR +\fBWARN\fR = \fI"yellow"\fR Defines color used for warnings. +.SH "LIST OF VALID ATTRIBUTES" +.TP +.B Foreground colors +.RS +.TP +.B black +.TP +.B darkgray +.TP +.B darkred +.TP +.B red +.TP +.B darkgreen +.TP +.B green +.TP +\fBbrown\fR = \fBdarkyellow\fR +.TP +.B yellow +.TP +.B darkblue +.TP +.B blue +.TP +.B purple +.TP +.B fuchsia +.TP +.B teal +.TP +.B turquoise +.TP +.B lightgray +.TP +.B white +.RE +.TP +.B Background colors +.RS +.TP +.B bg_black +.TP +.B bg_darkred +.TP +.B bg_darkgreen +.TP +\fBbg_brown\fR = \fBbg_darkyellow\fR +.TP +.B bg_darkblue +.TP +.B bg_purple +.TP +.B bg_teal +.TP +.B bg_lightgray +.RE +.TP +.B Other attributes +.RS +.TP +.B bold +.TP +.B faint +.TP +.B standout +.TP +.B underline +.TP +.B blink +.TP +.B reverse +.RE .SH "REPORTING BUGS" Please report bugs via http://bugs.gentoo.org/ .SH "AUTHORS" @@ -72,6 +143,7 @@ Contains variables customizing colors. .B /etc/make.conf Contains other variables. .SH "SEE ALSO" +.BR console_codes (4), .BR make.conf (5), .BR portage (5), .BR emerge (1), diff --git a/pym/output.py b/pym/output.py index 3a1bce4e0..ed95108fe 100644 --- a/pym/output.py +++ b/pym/output.py @@ -117,17 +117,17 @@ codes["darkteal"] = codes["turquoise"] # Some terminals have darkyellow instead of brown. codes["0xAAAA00"] = codes["brown"] codes["darkyellow"] = codes["0xAAAA00"] -codes["fuscia"] = codes["fuchsia"] -codes["white"] = codes["bold"] - -codes["bg_black"] = esc_seq + "40m" -codes["bg_red"] = esc_seq + "41m" -codes["bg_green"] = esc_seq + "42m" -codes["bg_brown"] = esc_seq + "43m" -codes["bg_blue"] = esc_seq + "44m" -codes["bg_magenta"] = esc_seq + "45m" -codes["bg_cyan"] = esc_seq + "46m" -codes["bg_white"] = esc_seq + "47m" + +codes["bg_black"] = esc_seq + "40m" +codes["bg_darkred"] = esc_seq + "41m" +codes["bg_darkgreen"] = esc_seq + "42m" +codes["bg_brown"] = esc_seq + "43m" +codes["bg_darkblue"] = esc_seq + "44m" +codes["bg_purple"] = esc_seq + "45m" +codes["bg_teal"] = esc_seq + "46m" +codes["bg_lightgray"] = esc_seq + "47m" + +codes["bg_darkyellow"] = codes["bg_brown"] # Colors from /sbin/functions.sh codes["GOOD"] = codes["green"] @@ -288,7 +288,7 @@ def colorize(color_key, text): return text compat_functions_colors = ["bold","white","teal","turquoise","darkteal", - "fuscia","fuchsia","purple","blue","darkblue","green","darkgreen","yellow", + "fuchsia","purple","blue","darkblue","green","darkgreen","yellow", "brown","darkyellow","red","darkred"] def create_color_func(color_key): -- 2.26.2