textmodetrees.py 文件源码

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

项目:udapi-python 作者: udapi 项目源码 文件源码
def before_process_document(self, document):
        """Initialize ANSI colors if color is True or 'auto'.

        If color=='auto', detect if sys.stdout is interactive
        (terminal, not redirected to a file).
        """
        super().before_process_document(document)
        if self.color == 'auto':
            self.color = sys.stdout.isatty()
            if self.color:
                colorama.init()
        if self.print_doc_meta:
            for key, value in sorted(document.meta.items()):
                print('%s = %s' % (key, value))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号