Merge pull request #1226 from prettykool/develop

fix: #1042  `NO_COLOR` support
Esse commit está contido em:
Talha Asghar
2023-06-14 16:04:16 +05:00
commit de GitHub
+6 -3
Ver Arquivo
@@ -4,12 +4,15 @@ import os
import re
import sys
if sys.stdout.isatty():
white = "\x1b[%sm" % 0
ul = "\x1b[%sm" * 3 % (2, 4, 33)
ul = "\x1b[%sm" * 2 % (2, 4)
if not os.getenv('NO_COLOR'):
ul += "\x1b[%33m"
cols = ["\x1b[%sm" % n for n in range(91, 96)]
red, green, yellow, blue, pink = cols
red, green, yellow, blue, pink = [""]*5 if os.getenv('NO_COLOR') else cols
else:
ul = red = green = yellow = blue = pink = white = ""