* Rename NEUTRAL color to BLANK for eblank.
authorZac Medico <zmedico@gentoo.org>
Tue, 17 Jun 2008 04:05:55 +0000 (04:05 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 17 Jun 2008 04:05:55 +0000 (04:05 -0000)
* 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

bin/isolated-functions.sh
man/color.map.5
pym/elog_modules/mod_echo.py
pym/output.py
pym/portage.py

index dd157129d0fdb54c2adff19076ec19180064fbe7..5851a55c7c6d56cac734fc54d94516837150f438 100644 (file)
@@ -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'
index ac1189ecb102cfcc6e4d5e46e7aa16f42d0652d9..7bda5b69ec5c78f4f3111efa7e76bb499490ef58 100644 (file)
@@ -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
index 5b13c924ffe21b51fd2b9b07e05261e9ff8173c8..f064a0dc0caa932d983d55a45d189a7e61f1f978 100644 (file)
@@ -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 = []
index e53e74bfbf0e1fc8ea0605d42a4c03a70a1de01c..d52c6cc557da5ceaaffc8dd7e0b06d523cae4622 100644 (file)
@@ -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
index f244f01535f245739be3db8c302b4270d9ccc047..fe0ceb904567112c4882540e8f1d047a365eefe2 100644 (file)
@@ -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)