summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-06-17 04:05:20 +0000
committerZac Medico <zmedico@gentoo.org>2008-06-17 04:05:20 +0000
commitf8e4453b4cd76184af5c155da2e4d7885666dd76 (patch)
treeaf7a050f51ad5d77d4ee70ab0664b5a82ee56474 /pym
parent466ea463005845f1fcc3760407ad2a4d9f75393b (diff)
downloadportage-f8e4453b4cd76184af5c155da2e4d7885666dd76.tar.gz
portage-f8e4453b4cd76184af5c155da2e4d7885666dd76.tar.bz2
portage-f8e4453b4cd76184af5c155da2e4d7885666dd76.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. svn path=/main/trunk/; revision=10677
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/__init__.py2
-rw-r--r--pym/portage/elog/mod_echo.py3
-rw-r--r--pym/portage/output.py16
3 files changed, 18 insertions, 3 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 45d27aede..4970d1a11 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -4452,7 +4452,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, portage.output.codes[c]))
mysettings["PORTAGE_COLORMAP"] = "\n".join(mycolors)
diff --git a/pym/portage/elog/mod_echo.py b/pym/portage/elog/mod_echo.py
index 30d88f005..1c83600a4 100644
--- a/pym/portage/elog/mod_echo.py
+++ b/pym/portage/elog/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}
if isinstance(msgcontent, basestring):
msgcontent = [msgcontent]
for line in msgcontent:
diff --git a/pym/portage/output.py b/pym/portage/output.py
index 3c6533106..4d0ab42ec 100644
--- a/pym/portage/output.py
+++ b/pym/portage/output.py
@@ -138,7 +138,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"]
@@ -544,6 +544,20 @@ class EOutput(object):
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