Skip to content

Commit 88cb015

Browse files
author
Christoffer Rehn
committed
Add support for NO_COLOR
1 parent 6935504 commit 88cb015

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

kitten/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import fabric
1515
from six.moves import range, queue
1616

17-
__version__ = "0.2.13"
17+
__version__ = "0.2.14"
1818

1919
CHUNK_SIZE = 100
2020
DEFAULT = {"threads": 10, "timeout": 10}
@@ -50,9 +50,9 @@ def ansi(x):
5050

5151

5252
def colored(s, code=0, bold=False):
53-
if sys.stdout.isatty():
54-
return "{}{}{}{}".format(ansi(code), ansi(1) if bold else "", s, ansi(0))
55-
return s
53+
if not sys.stdout.isatty() or "NO_COLOR" in os.environ:
54+
return s
55+
return "{}{}{}{}".format(ansi(code), ansi(1) if bold else "", s, ansi(0))
5656

5757

5858
def red(s):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="kitten",
8-
version="0.2.13",
8+
version="0.2.14",
99
author="Chris Rehn",
1010
author_email="chris@rehn.me",
1111
description="Tiny multi-server automation tool.",

0 commit comments

Comments
 (0)