stack_status_colourer.py 文件源码

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

项目:sceptre 作者: cloudreach 项目源码 文件源码
def colour(self, string):
        """
        Colours all Stack Statueses in ``string``.

        The colours applied are defined in
        ``sceptre.stack_status_colourer.StackStatusColourer.STACK_STATUS_CODES``

        :param string: A string to colour.
        :type string: str
        :returns: The string with all stack status values coloured.
        :rtype: str
        """
        stack_statuses = re.findall(self.STACK_STATUS_PATTERN, string)
        for status in stack_statuses:
            string = re.sub(
                r"\b{0}\b".format(status),
                "{0}{1}{2}".format(
                    self.STACK_STATUS_CODES[status], status, Style.RESET_ALL
                ),
                string
            )
        return string
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号