cli.py 文件源码

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

项目:Zappa 作者: Miserlou 项目源码 文件源码
def format_invoke_command(self, string):
        """
        Formats correctly the string ouput from the invoke() method,
        replacing line breaks and tabs when necessary.
        """

        string = string.replace('\\n', '\n')

        formated_response = ''
        for line in string.splitlines():
            if line.startswith('REPORT'):
                line = line.replace('\t', '\n')
            if line.startswith('[DEBUG]'):
                line = line.replace('\t', ' ')
            formated_response += line + '\n'
        formated_response = formated_response.replace('\n\n', '\n')

        return formated_response
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号