def colorize(self, logfile=None): """Can be output colored?""" return isatty(sys.stderr) if logfile is None else False
def __init__(self, app=None, stdout=sys.stdout, stderr=sys.stderr): self.app = thriftpool.thriftpool if app is None else app self.colored = colored( enabled=all([isatty(out) for out in (sys.stderr, sys.stdout)])) self.stdout = stdout self.stderr = stderr
def __init__(self, app=None, stdout=sys.stdout, stderr=sys.stderr): self.app = thriftpool.thriftpool if app is None else app self.colored = colored(enabled=all([isatty(out) for out in (sys.stderr, sys.stdout)])) self.stdout = stdout self.stderr = stderr