sync_kibana_objects.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:ansible-role-elk-kibana 作者: jpnewman 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号