ui.py 文件源码

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

项目:py-cloud-compute-cannon 作者: Autodesk 项目源码 文件源码
def render_string(self):
        height = '%spx' % min(self._string.count('\n') * 16 + 36, 600)
        try:
            self.textarea = ipy.Textarea(self._string[:self.CHUNK],
                                         layout=Layout(width='100%', height=height))
        except traitlets.TraitError:
            self.textarea = ipy.Textarea('[NOT SHOWN - UNABLE TO DECODE FILE]',
                                         layout=Layout(height='300px',
                                                       **self.TEXTAREA_KWARGS))
            return
        finally:
            self.children = [self.textarea]
            self._current_pos = self.CHUNK

        if len(self._string) > self.CHUNK:
            self.textarea.value += self.TRUNCATE_MESSAGE
            self.load_more_button = ipy.Button(description='See more')
            self.load_more_button.on_click(self.load_more)
            self.children = self.children + (self.load_more_button,)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号