def __has_colors(stream, allow_piping=False):
"""Check if Console Has Color."""
if not hasattr(stream, "isatty"):
return False
if not stream.isatty(): # not being piped or redirected
return allow_piping # auto color only on TTYs
try:
import curses
curses.setupterm()
return curses.tigetnum("colors") > 2
except:
# guess false in case of error
return False
# Has Color Init
sync_kibana_objects.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录