Commit a4ca3823 authored by Seblu's avatar Seblu
Browse files

Print color only on a tty

parent dbd2d9d0
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -47,7 +47,10 @@ def out(message="", fd=sys.stdout, endl=os.linesep, flush=True):
    '''
    # color subsitution
    for c in color:
        if fd.isatty():
            message = message.replace("#%s#" % c, color[c])
        else:
            message = message.replace("#%s#" % c, "")
    # printing
    fd.write("%s%s" % (message, endl))
    if flush: