main.py 文件源码

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

项目:scum 作者: CCareaga 项目源码 文件源码
def delete_tab(self, fname):
        files = self.display.file_names
        # make sure there is more than one file open
        if len(files) > 1:
            index = files.index(fname)
            if index < len(files)-1: # if not last in list
                new_name = files[index+1]
            else: # if last file in list
                new_name = files[index-1]
            # delete file and contents from master lists
            #del self.display.tab_info[fname]
            del files[index]
            del self.display.tabs[index]
            # reset the footer with new tab amount
            foot_col = urwid.Columns(self.display.tabs)
            foot = urwid.AttrMap(foot_col, 'footer')
            if self.display.layout:
                self.display.top.contents['header'] = (foot, None)
            else:
                self.display.top.contents['footer'] = (foot, None)

            self.switch_tabs(new_name)
            del self.display.tab_info[fname]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号