win_history.py 文件源码

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

项目:wahcade 作者: sairuk 项目源码 文件源码
def set_history(self, rom_name, game_name):
        """display history for rom_name"""
        if not self.histview_ok:
            return
        rom_name = rom_name.upper()
        #display
        self.lsHistory = []
        if rom_name not in self.history:
            self.lblHeading.set_text('no history found')
            self.WinMain.show_window('history')
            return
        tw = textwrap.TextWrapper(width=self.line_length, replace_whitespace=False)
        for line in self.history[rom_name]:
            if line == ' ':
                wrapped_lines = ['']
            else:
                wrapped_lines = tw.wrap(line)
            for wl in wrapped_lines:
                self.lsHistory.append(wl)
        self.sclHistory.ls = self.lsHistory
        self.lblHeading.set_text(game_name)
        self.sclHistory.set_selected(0)
        self.WinMain.show_window('history')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号