patch_progress.py 文件源码

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

项目:envmgr-cli 作者: trainline 项目源码 文件源码
def update(self, n_total, n_lc_updated, n_scaling_out, n_scaled_out, n_services_installed, n_scaling_in, n_complete, *args):
        msg = '[Patching {0} ASGs]: '.format(n_total)
        stages = []
        if n_lc_updated is not 0:
            stages.append('{0} Launch Configs Updated'.format(n_lc_updated))
        if n_scaling_out is not 0:
            stages.append('{0} Scaling Out'.format(n_scaling_out))
        if n_scaled_out is not 0:
            stages.append('{0} Installing Services'.format(n_scaled_out))
        if n_scaling_in is not 0:
            stages.append('{0} Scaling In'.format(n_scaling_in))
        if n_complete is not 0:
            stages.append('{0} Complete'.format(n_complete))
        msg += ', '.join(stages)
        self.widgets[4] = FormatLabel(msg)
        t1 = (5 / n_total) * n_lc_updated
        t2 = (10 / n_total) * n_scaling_out
        t3 = (30 / n_total) * n_scaled_out
        t4 = (70 / n_total) * n_services_installed
        t5 = (75 / n_total) * n_scaling_in
        t6 = (100 / n_total) * n_complete
        self.total_progress = t1 + t2 + t3 + t4 + t5 + t6
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号