make_runner.py 文件源码

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

项目:gnu-make-toolkit 作者: gvalkov 项目源码 文件源码
def format_error(self, script, res) -> str:
        template = '''
        {cmd}

        Script:
        {script}

        Output:
        {stderr}
        '''

        def indent(text, prefix='>  '):
            return textwrap.indent(text.strip(), prefix, lambda line: True)

        template = textwrap.dedent(template).rstrip()
        return template.format(
            cmd=indent(' '.join(res.args)),
            script=indent(script),
            stderr=indent(res.stderr.decode('utf8')),
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号