1
0
Fork 0
forked from github/pelican

Pelican no more use ANSI codes on Windows (CMD.exe don't support it)

This commit is contained in:
Skami18 2011-10-14 17:21:03 +02:00
commit 3bdb1eae0b

View file

@ -66,7 +66,8 @@ class DummyFormatter(object):
""" """
def __new__(cls, *args, **kwargs): def __new__(cls, *args, **kwargs):
if os.isatty(sys.stdout.fileno()): # thanks to http://stackoverflow.com/questions/2086961/how-can-i-determine-if-a-python-script-is-executed-from-crontab/2087031#2087031 if os.isatty(sys.stdout.fileno())\
and not sys.platform.startswith('win'):
return ANSIFormatter(*args, **kwargs) return ANSIFormatter(*args, **kwargs)
else: else:
return TextFormatter( *args, **kwargs) return TextFormatter( *args, **kwargs)