colors.py 文件源码

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

项目:python-flask-security 作者: weinbergdavid 项目源码 文件源码
def __init__(self, env, explicit_json=False,
                 color_scheme=DEFAULT_STYLE, **kwargs):
        super(ColorFormatter, self).__init__(**kwargs)
        if not env.colors:
            self.enabled = False
            return

        # --json, -j
        self.explicit_json = explicit_json

        try:
            style_class = pygments.styles.get_style_by_name(color_scheme)
        except ClassNotFound:
            style_class = Solarized256Style

        if env.colors == 256:
            fmt_class = Terminal256Formatter
        else:
            fmt_class = TerminalFormatter
        self.formatter = fmt_class(style=style_class)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号