* Document the new BLANK code in color.map.5.
* Implement python version of eblank for mod_echo.
svn path=/main/trunk/; revision=10677
[[ ${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
}
COLS="25 80"
ENDCOL=
- NEUTRAL=
+ BLANK=
GOOD=
WARN=
BAD=
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'
\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
# 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, portage.output.codes[c]))
mysettings["PORTAGE_COLORMAP"] = "\n".join(mycolors)
"WARN": printer.ewarn,
"ERROR": printer.eerror,
"LOG": printer.einfo,
- "QA": printer.ewarn}
+ "QA": printer.ewarn,
+ "BLANK": printer.eblank}
if isinstance(msgcontent, basestring):
msgcontent = [msgcontent]
for line in msgcontent:
# 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"]
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