Permalink
Browse files

Add support for NO_COLOR

  • Loading branch information...
hoffa committed Jun 6, 2018
1 parent 6935504 commit 88cb015f4ae021a1c00bfc4dc9506a8e14e51bb4
Showing with 5 additions and 5 deletions.
  1. +4 −4 kitten/__init__.py
  2. +1 −1 setup.py
@@ -14,7 +14,7 @@
import fabric
from six.moves import range, queue
__version__ = "0.2.13"
__version__ = "0.2.14"
CHUNK_SIZE = 100
DEFAULT = {"threads": 10, "timeout": 10}
@@ -50,9 +50,9 @@ def ansi(x):
def colored(s, code=0, bold=False):
if sys.stdout.isatty():
return "{}{}{}{}".format(ansi(code), ansi(1) if bold else "", s, ansi(0))
return s
if not sys.stdout.isatty() or "NO_COLOR" in os.environ:
return s
return "{}{}{}{}".format(ansi(code), ansi(1) if bold else "", s, ansi(0))
def red(s):
@@ -5,7 +5,7 @@
setuptools.setup(
name="kitten",
version="0.2.13",
version="0.2.14",
author="Chris Rehn",
author_email="chris@rehn.me",
description="Tiny multi-server automation tool.",

0 comments on commit 88cb015

Please sign in to comment.