summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-06-17 04:05:55 +0000
committerZac Medico <zmedico@gentoo.org>2008-06-17 04:05:55 +0000
commit8ed14ff79aac316cba4e5268f059ce16b5938fb4 (patch)
tree2e8009da99ddd3ed3a0ee4ca536774c6702d324d
parent7e4e54c332954d04f3d72dbdf9d9760621306ae7 (diff)
downloadportage-8ed14ff79aac316cba4e5268f059ce16b5938fb4.tar.gz
portage-8ed14ff79aac316cba4e5268f059ce16b5938fb4.tar.bz2
portage-8ed14ff79aac316cba4e5268f059ce16b5938fb4.zip
* Rename NEUTRAL color to BLANK for eblank.
* Document the new BLANK code in color.map.5. * Implement python version of eblank for mod_echo. (trunk r10677) svn path=/main/branches/2.1.2/; revision=10678
-rw-r--r--bin/isolated-functions.sh6
-rw-r--r--man/color.map.53
-rw-r--r--pym/elog_modules/mod_echo.py3
-rw-r--r--pym/output.py16
-rw-r--r--pym/portage.py2
5 files changed, 24 insertions, 6 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index dd157129d..5851a55c7 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -178,7 +178,7 @@ eblank() {
[[ ${LAST_E_CMD} == "eblank" ]] && return 0
elog_base BLANK
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
- echo -e " ${NEUTRAL}*${NORMAL}"
+ echo -e " ${BLANK}*${NORMAL}"
LAST_E_CMD="eblank"
return 0
}
@@ -353,7 +353,7 @@ unset_colors() {
COLS="25 80"
ENDCOL=
- NEUTRAL=
+ BLANK=
GOOD=
WARN=
BAD=
@@ -376,7 +376,7 @@ set_colors() {
if [ -n "${PORTAGE_COLORMAP}" ] ; then
eval ${PORTAGE_COLORMAP}
else
- NEUTRAL=$'\e[37m'
+ BLANK=$'\e[37m'
GOOD=$'\e[32;01m'
WARN=$'\e[33;01m'
BAD=$'\e[31;01m'
diff --git a/man/color.map.5 b/man/color.map.5
index ac1189ecb..7bda5b69e 100644
--- a/man/color.map.5
+++ b/man/color.map.5
@@ -27,6 +27,9 @@ Defines color used for highlighted words.
\fBINFORM\fR = \fI"darkgreen"\fR
Defines color used for informational words.
.TP
+\fBBLANK\fR = \fI"darkgray"\fR
+Defines color used to display eblank lines.
+.TP
\fBMERGE_LIST_PROGRESS\fR = \fI"yellow"\fR
Defines color used for numbers indicating merge progress.
.TP
diff --git a/pym/elog_modules/mod_echo.py b/pym/elog_modules/mod_echo.py
index 5b13c924f..f064a0dc0 100644
--- a/pym/elog_modules/mod_echo.py
+++ b/pym/elog_modules/mod_echo.py
@@ -33,7 +33,8 @@ def finalize(mysettings=None):
"WARN": printer.ewarn,
"ERROR": printer.eerror,
"LOG": printer.einfo,
- "QA": printer.ewarn}
+ "QA": printer.ewarn,
+ "BLANK": printer.eblank}
for line in msgcontent:
fmap[msgtype](line.strip("\n"))
_items = []
diff --git a/pym/output.py b/pym/output.py
index e53e74bfb..d52c6cc55 100644
--- a/pym/output.py
+++ b/pym/output.py
@@ -132,7 +132,7 @@ codes["bg_darkyellow"] = codes["bg_brown"]
# Colors from /etc/init.d/functions.sh
codes["NORMAL"] = esc_seq + "0m"
-codes["NEUTRAL"] = codes["lightgray"]
+codes["BLANK"] = codes["lightgray"]
codes["GOOD"] = codes["green"]
codes["WARN"] = codes["yellow"]
codes["BAD"] = codes["red"]
@@ -486,6 +486,20 @@ class EOutput:
sys.stdout.flush()
self.__last_e_cmd = "ewarn"
+ def eblank(self, msg):
+ """
+ Shows a blank line. Consecutive eblank calls are all collapsed
+ into a single blank line.
+ """
+ if self.__last_e_cmd == "eblank":
+ return
+ if not self.quiet:
+ if self.__last_e_cmd == "ebegin":
+ sys.stdout.write("\n")
+ sys.stdout.write(colorize("BLANK", " * ") + "\n")
+ sys.stdout.flush()
+ self.__last_e_cmd = "eblank"
+
def ewend(self, errno, *msg):
"""
Indicates the completion of a process, optionally displaying a message
diff --git a/pym/portage.py b/pym/portage.py
index f244f0153..fe0ceb904 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -4462,7 +4462,7 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, m
# Allow color.map to control colors associated with einfo, ewarn, etc...
mycolors = []
- for c in ("NEUTRAL", "GOOD", "WARN", "BAD", "HILITE", "BRACKET"):
+ for c in ("BLANK", "GOOD", "WARN", "BAD", "HILITE", "BRACKET"):
mycolors.append("%s=$'%s'" % (c, output.codes[c]))
mysettings["PORTAGE_COLORMAP"] = "\n".join(mycolors)