main.py 文件源码

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

项目:scum 作者: CCareaga 项目源码 文件源码
def switch_states(self, state):
        # this method is run to switch states, it reassigns what content is in the Frame
        if state == 'editor':
            self.top.contents['header'] = (self.status, None)
            self.top.contents['body'] = (self.body_col, None)
            self.top.contents['footer'] = (self.foot_col, None)
            if self.layout:
                self.top.contents['footer'] = (self.status, None)
                self.top.contents['header'] = (self.foot_col, None)

        elif state == 'openfile':
            path = strip_path(self.listbox.fname)
            self.browser = urwid.TreeListBox(urwid.TreeWalker(DirectoryNode(path, self)))
            self.top.contents['header'] = (self.oftbar, None)
            self.top.contents['body'] = (self.browser, None)
            self.top.contents['footer'] = (self.ofbbar, None)
            self.ofbbar.set_text('')

        self.state = state
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号