From 70e1159947b8fbaeec8bec8db3f20948e9bd7161 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Sun, 28 Jul 2019 08:35:40 +0300 Subject: [PATCH] consolidate diffs --- pysollib/tile/selectgame.py | 6 +++--- pysollib/tk/selectgame.py | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/pysollib/tile/selectgame.py b/pysollib/tile/selectgame.py index 6ebd61a2..b24d86ea 100644 --- a/pysollib/tile/selectgame.py +++ b/pysollib/tile/selectgame.py @@ -21,7 +21,6 @@ # # --------------------------------------------------------------------------- - import os from pysollib.gamedb import GI @@ -80,7 +79,8 @@ class SelectGameData(SelectDialogTreeData): def __init__(self, app): SelectDialogTreeData.__init__(self) self.all_games_gi = list(map( - app.gdb.get, app.gdb.getGamesIdSortedByName())) + app.gdb.get, + app.gdb.getGamesIdSortedByName())) self.no_games = [SelectGameLeaf(None, None, _("(no games)"), None), ] # s_by_type = s_oriental = s_special = s_original = s_contrib = \ @@ -321,7 +321,7 @@ class SelectGameDialog(MfxDialog): if button == 0: # Ok or double click self.gameid = self.tree.selection_key self.tree.n_expansions = 1 # save xyview in any case - if button == 10: # Rules + if button == 1: # Rules doc = self.app.getGameRulesFilename(self.tree.selection_key) if not doc: return diff --git a/pysollib/tk/selectgame.py b/pysollib/tk/selectgame.py index 393649f0..a119a9f9 100644 --- a/pysollib/tk/selectgame.py +++ b/pysollib/tk/selectgame.py @@ -24,7 +24,6 @@ import os from pysollib.gamedb import GI -from pysollib.help import help_html from pysollib.mfxutil import KwStruct, Struct, destruct from pysollib.mfxutil import format_time from pysollib.mygettext import _ @@ -39,11 +38,11 @@ from .selecttree import SelectDialogTreeCanvas from .selecttree import SelectDialogTreeLeaf, SelectDialogTreeNode from .tkwidget import MfxDialog, MfxScrolledCanvas - # ************************************************************************ # * Nodes # ************************************************************************ + class SelectGameLeaf(SelectDialogTreeLeaf): pass @@ -137,7 +136,6 @@ class SelectGameData(SelectDialogTreeData): if 1 and gg: s_by_compatibility = SelectGameNode(None, _("by Compatibility"), tuple(gg)) - pass # s_by_pysol_version, gg = None, [] for name, games in GI.GAMES_BY_PYSOL_VERSION: @@ -308,8 +306,8 @@ class SelectGameDialog(MfxDialog): def initKw(self, kw): kw = KwStruct(kw, strings=(None, None, _("&Cancel"),), default=0, - separator=True, resizable=True, + separator=True, padx=10, pady=10, buttonpadx=10, buttonpady=5, ) @@ -322,14 +320,15 @@ class SelectGameDialog(MfxDialog): MfxDialog.destroy(self) def mDone(self, button): - if button == 0: # Ok or double click + if button == 0: # Ok or double click self.gameid = self.tree.selection_key self.tree.n_expansions = 1 # save xyview in any case - if button == 1: # Rules + if button == 1: # Rules doc = self.app.getGameRulesFilename(self.tree.selection_key) if not doc: return dir = os.path.join("html", "rules") + from pysollib.help import help_html help_html(self.app, doc, dir, self.top) return MfxDialog.mDone(self, button)