ui.py 文件源码

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

项目:py-cloud-compute-cannon 作者: Autodesk 项目源码 文件源码
def __init__(self, job, **kwargs):
        kwargs.setdefault('orientation', 'vertical')

        super(StatusView,self).__init__(**kwargs)
        self._job = job
        stat = job.status
        statstring = self.STATUS_STRING % (job.name,
                                           str(job.engine),
                                           job.jobid,
                                           job.image,
                                           job.command,
                                           stat)
        try:
            statstring += '<br><b>Exit code: </b> %s</br>' % job.exitcode
        except JobStillRunning:
            pass

        text = ipy.HTML(statstring)

        if stat == status.QUEUED:
            bar_spec = dict(value=1, bar_style='danger')
        elif stat == status.RUNNING:
            bar_spec = dict(value=50, bar_style='info')
        elif stat == status.FINISHED:
            bar_spec = dict(value=100, bar_style='success')
        else:
            bar_spec = dict(value=100, bar_style='danger')
        bar = ipy.FloatProgress(**bar_spec)
        self.children = [text, bar]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号