[pypy-svn] r36271 - pypy/dist/pypy/tool

cfbolz at codespeak.net cfbolz at codespeak.net
Mon Jan 8 14:51:38 CET 2007


Author: cfbolz
Date: Mon Jan  8 14:51:37 2007
New Revision: 36271

Modified:
   pypy/dist/pypy/tool/ansi_print.py
Log:
ansi_print itself moved to the py-lib


Modified: pypy/dist/pypy/tool/ansi_print.py
==============================================================================
--- pypy/dist/pypy/tool/ansi_print.py	(original)
+++ pypy/dist/pypy/tool/ansi_print.py	Mon Jan  8 14:51:37 2007
@@ -4,21 +4,7 @@
 
 import sys
 
-def ansi_print(text, esc, file=None, newline=True, flush=False):
-    if file is None: file = sys.stderr
-    text = text.rstrip()
-    if esc and sys.platform != "win32" and file.isatty():
-        if not isinstance(esc, tuple):
-            esc = (esc,)
-        text = (''.join(['\x1b[%sm' % cod for cod in esc])  +  
-                text +
-                '\x1b[0m')     # ANSI color code "reset"
-    if newline:
-        text += '\n'
-    file.write(text)
-    if flush:
-        file.flush()
-
+from py.__.misc.terminal_helper import ansi_print
 
 class AnsiLog:
 



More information about the Pypy-commit mailing list