[pypy-svn] pypy default: using dev version of py with terminal coloring fix (thanks amaury for pointing out)

hpk42 commits-noreply at bitbucket.org
Fri Mar 11 13:57:18 CET 2011


Author: holger krekel <holger at merlinux.eu>
Branch: 
Changeset: r42510:a5125605632b
Date: 2011-03-11 13:56 +0100
http://bitbucket.org/pypy/pypy/changeset/a5125605632b/

Log:	using dev version of py with terminal coloring fix (thanks amaury
	for pointing out)

diff --git a/py/_io/terminalwriter.py b/py/_io/terminalwriter.py
--- a/py/_io/terminalwriter.py
+++ b/py/_io/terminalwriter.py
@@ -199,8 +199,10 @@
                     attr |= FOREGROUND_BLUE
                 elif kw.pop('green', False):
                     attr |= FOREGROUND_GREEN
+                elif kw.pop('yellow', False):
+                    attr |= FOREGROUND_GREEN|FOREGROUND_RED
                 else:
-                    attr |= FOREGROUND_BLACK # (oldcolors & 0x0007)
+                    attr |= oldcolors & 0x0007
 
                 SetConsoleTextAttribute(handle, attr)
             if not isinstance(self._file, WriteFile):
@@ -211,7 +213,8 @@
                 SetConsoleTextAttribute(handle, oldcolors)
 
     def line(self, s="", **kw):
-        self.write(s+"\n", **kw)
+        self.write(s, **kw) # works better for resetting colors
+        self.write("\n")
 
 class WriteFile(object):
     def __init__(self, writemethod, encoding=None):

diff --git a/py/__init__.py b/py/__init__.py
--- a/py/__init__.py
+++ b/py/__init__.py
@@ -8,7 +8,7 @@
 
 (c) Holger Krekel and others, 2004-2010
 """
-__version__ = '1.4.2'
+__version__ = '1.4.3.dev0'
 
 from py import _apipkg
 


More information about the Pypy-commit mailing list