Support forcing colorama colors on.
authorTim 'mithro' Ansell <me@mith.ro>
Thu, 18 Jan 2018 03:41:45 +0000 (14:41 +1100)
committerTim 'mithro' Ansell <me@mith.ro>
Thu, 18 Jan 2018 03:41:45 +0000 (14:41 +1100)
This is needed if you want colors but are using pipes and similar.

litex/build/xilinx/common.py

index 170e67e258827c167364bb03703aeb9bd08958e7..4c59a9983dfb4548f3312345b4feb70483632f1a 100644 (file)
@@ -2,7 +2,11 @@ import os
 import sys
 try:
     import colorama
-    colorama.init()  # install escape sequence translation on Windows
+    # install escape sequence translation on Windows
+    if os.getenv("COLORAMA", "") == "force":
+        colorama.init(strip=False)
+    else:
+        colorama.init()
     _have_colorama = True
 except ImportError:
     _have_colorama = False