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)
评论列表
文章目录