Skip to content

Commit

Permalink
Add support for NO_COLOR
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoffer Rehn committed Jun 6, 2018
1 parent 6935504 commit 88cb015
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions kitten/__init__.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import fabric import fabric
from six.moves import range, queue from six.moves import range, queue


__version__ = "0.2.13" __version__ = "0.2.14"


CHUNK_SIZE = 100 CHUNK_SIZE = 100
DEFAULT = {"threads": 10, "timeout": 10} DEFAULT = {"threads": 10, "timeout": 10}
Expand Down Expand Up @@ -50,9 +50,9 @@ def ansi(x):




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




def red(s): def red(s):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


setuptools.setup( setuptools.setup(
name="kitten", name="kitten",
version="0.2.13", version="0.2.14",
author="Chris Rehn", author="Chris Rehn",
author_email="chris@rehn.me", author_email="chris@rehn.me",
description="Tiny multi-server automation tool.", description="Tiny multi-server automation tool.",
Expand Down

0 comments on commit 88cb015

Please sign in to comment.