forked from github/pelican
Pelican no more use ANSI codes on Windows (CMD.exe don't support it)
This commit is contained in:
parent
1bd2af1064
commit
3bdb1eae0b
1 changed files with 2 additions and 1 deletions
|
|
@ -66,7 +66,8 @@ class DummyFormatter(object):
|
|||
"""
|
||||
|
||||
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)
|
||||
else:
|
||||
return TextFormatter( *args, **kwargs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue