historic_job.py 文件源码

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

项目:apart-gtk 作者: alexheretic 项目源码 文件源码
def update(self):
        finished_delta = datetime.now(timezone.utc) - self.finish
        if finished_delta < timedelta(minutes=1):
            finished_str = "just now"
        else:
            finished_str = humanize.naturaltime(finished_delta)

        self.finish_label.set_text(finished_str)

        self.rerun_btn.set_sensitive(self.source_available == SourceAvailability.AVAILABLE
                                     and self.compression_available)
        tooltip = RERUN_TIP
        if self.source_available == SourceAvailability.MOUNTED:
            tooltip = rm_dev(self.msg['source']) + " is currently mounted"
        elif self.source_available == SourceAvailability.GONE:
            tooltip = rm_dev(self.msg['source']) + " is not currently available"
        elif self.source_available == SourceAvailability.UUID_MISMATCH:
            tooltip = 'current {} does not match cloned partition uuid'\
                .format(rm_dev(self.msg['source']))
        elif not self.compression_available:
            tooltip = extract_compression_option(self.msg['destination']) + \
                      ' compression is not installed'
        self.rerun_btn.set_tooltip_text(tooltip)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号