]> Witch of Git - ivy/blob - tools/fmt.py
[tools] Format code
[ivy] / tools / fmt.py
1 import sys
2
3 IS_TTY = sys.stdout.isatty()
4
5
6 def red(x):
7 if not IS_TTY:
8 return x
9 return f"\033[31m{x}\033[0m"
10
11
12 def green(x):
13 if not IS_TTY:
14 return x
15 return f"\033[32m{x}\033[0m"
16
17
18 def yellow(x):
19 if not IS_TTY:
20 return x
21 return f"\033[33m{x}\033[0m"
22
23
24 def blue(x):
25 if not IS_TTY:
26 return x
27 return f"\033[34m{x}\033[0m"