diff --git a/pysollib/tk/selectcardset.py b/pysollib/tk/selectcardset.py index a297fd2f..edc977ae 100644 --- a/pysollib/tk/selectcardset.py +++ b/pysollib/tk/selectcardset.py @@ -28,7 +28,7 @@ import os import Tkinter # PySol imports -from pysollib.mygettext import _, n_ +from pysollib.mygettext import _ from pysollib.mfxutil import KwStruct, USE_PIL from pysollib.util import CARDSET from pysollib.resource import CSI @@ -54,7 +54,8 @@ class SelectCardsetNode(SelectDialogTreeNode): contents = [] for obj in self.tree.data.all_objects: if self.select_func(obj): - node = SelectCardsetLeaf(self.tree, self, text=obj.name, key=obj.index) + node = SelectCardsetLeaf( + self.tree, self, text=obj.name, key=obj.index) contents.append(node) return contents or self.tree.data.no_contents @@ -68,59 +69,92 @@ class SelectCardsetData(SelectDialogTreeData): SelectDialogTreeData.__init__(self) self.all_objects = manager.getAllSortedByName() self.all_objects = [obj for obj in self.all_objects if not obj.error] - self.no_contents = [ SelectCardsetLeaf(None, None, _("(no cardsets)"), key=None), ] + self.no_contents = [SelectCardsetLeaf( + None, None, _("(no cardsets)"), key=None), ] # select_by_type = None items = CSI.TYPE.items() - items.sort(lambda a, b: cmp(a[1], b[1])) + items.sort(key=lambda x: x[1]) nodes = [] for key, name in items: if manager.registered_types.get(key): - nodes.append(SelectCardsetNode(None, name, lambda cs, key=key: key == cs.si.type)) + nodes.append( + SelectCardsetNode( + None, name, lambda cs, key=key: key == cs.si.type)) if nodes: - select_by_type = SelectCardsetNode(None, _("by Type"), tuple(nodes), expanded=1) + select_by_type = SelectCardsetNode( + None, _("by Type"), tuple(nodes), expanded=1) # select_by_style = None items = CSI.STYLE.items() - items.sort(lambda a, b: cmp(a[1], b[1])) + items.sort(key=lambda x: x[1]) nodes = [] for key, name in items: if manager.registered_styles.get(key): - nodes.append(SelectCardsetNode(None, name, lambda cs, key=key: key in cs.si.styles)) + nodes.append( + SelectCardsetNode( + None, name, lambda cs, key=key: key in cs.si.styles)) if nodes: - nodes.append(SelectCardsetNode(None, _("Uncategorized"), lambda cs: not cs.si.styles)) - select_by_style = SelectCardsetNode(None, _("by Style"), tuple(nodes)) + nodes.append( + SelectCardsetNode( + None, _("Uncategorized"), lambda cs: not cs.si.styles)) + select_by_style = SelectCardsetNode( + None, _("by Style"), tuple(nodes)) # select_by_nationality = None items = CSI.NATIONALITY.items() - items.sort(lambda a, b: cmp(a[1], b[1])) + items.sort(key=lambda x: x[1]) nodes = [] for key, name in items: if manager.registered_nationalities.get(key): - nodes.append(SelectCardsetNode(None, name, lambda cs, key=key: key in cs.si.nationalities)) + nodes.append( + SelectCardsetNode( + None, name, + lambda cs, key=key: key in cs.si.nationalities)) if nodes: - nodes.append(SelectCardsetNode(None, _("Uncategorized"), lambda cs: not cs.si.nationalities)) - select_by_nationality = SelectCardsetNode(None, _("by Nationality"), tuple(nodes)) + nodes.append( + SelectCardsetNode( + None, _("Uncategorized"), + lambda cs: not cs.si.nationalities)) + select_by_nationality = SelectCardsetNode( + None, _("by Nationality"), tuple(nodes)) # select_by_date = None items = CSI.DATE.items() - items.sort(lambda a, b: cmp(a[1], b[1])) + items.sort(key=lambda x: x[1]) nodes = [] for key, name in items: if manager.registered_dates.get(key): - nodes.append(SelectCardsetNode(None, name, lambda cs, key=key: key in cs.si.dates)) + nodes.append( + SelectCardsetNode( + None, name, lambda cs, key=key: key in cs.si.dates)) if nodes: - nodes.append(SelectCardsetNode(None, _("Uncategorized"), lambda cs: not cs.si.dates)) - select_by_date = SelectCardsetNode(None, _("by Date"), tuple(nodes)) + nodes.append( + SelectCardsetNode( + None, _("Uncategorized"), lambda cs: not cs.si.dates)) + select_by_date = SelectCardsetNode( + None, _("by Date"), tuple(nodes)) # self.rootnodes = filter(None, ( - SelectCardsetNode(None, _("All Cardsets"), lambda cs: 1, expanded=len(self.all_objects)<=12), + SelectCardsetNode( + None, _("All Cardsets"), + lambda cs: 1, expanded=len(self.all_objects) <= 12), SelectCardsetNode(None, _("by Size"), ( - SelectCardsetNode(None, _("Tiny cardsets"), lambda cs: cs.si.size == CSI.SIZE_TINY), - SelectCardsetNode(None, _("Small cardsets"), lambda cs: cs.si.size == CSI.SIZE_SMALL), - SelectCardsetNode(None, _("Medium cardsets"), lambda cs: cs.si.size == CSI.SIZE_MEDIUM), - SelectCardsetNode(None, _("Large cardsets"), lambda cs: cs.si.size == CSI.SIZE_LARGE), - SelectCardsetNode(None, _("XLarge cardsets"), lambda cs: cs.si.size == CSI.SIZE_XLARGE), + SelectCardsetNode( + None, _("Tiny cardsets"), + lambda cs: cs.si.size == CSI.SIZE_TINY), + SelectCardsetNode( + None, _("Small cardsets"), + lambda cs: cs.si.size == CSI.SIZE_SMALL), + SelectCardsetNode( + None, _("Medium cardsets"), + lambda cs: cs.si.size == CSI.SIZE_MEDIUM), + SelectCardsetNode( + None, _("Large cardsets"), + lambda cs: cs.si.size == CSI.SIZE_LARGE), + SelectCardsetNode( + None, _("XLarge cardsets"), + lambda cs: cs.si.size == CSI.SIZE_XLARGE), ), expanded=1), select_by_type, select_by_style, @@ -133,15 +167,18 @@ class SelectCardsetByTypeData(SelectDialogTreeData): def __init__(self, manager, key): SelectDialogTreeData.__init__(self) self.all_objects = manager.getAllSortedByName() - self.no_contents = [ SelectCardsetLeaf(None, None, _("(no cardsets)"), key=None), ] + self.no_contents = [SelectCardsetLeaf( + None, None, _("(no cardsets)"), key=None), ] # items = CSI.TYPE.items() - items.sort(lambda a, b: cmp(a[1], b[1])) + items.sort(key=lambda x: x[1]) nodes = [] for key, name in items: if manager.registered_types.get(key): - nodes.append(SelectCardsetNode(None, name, lambda cs, key=key: key == cs.si.type)) - select_by_type = SelectCardsetNode(None, _("by Type"), tuple(nodes), expanded=1) + nodes.append(SelectCardsetNode( + None, name, lambda cs, key=key: key == cs.si.type)) + select_by_type = SelectCardsetNode( + None, _("by Type"), tuple(nodes), expanded=1) # self.rootnodes = filter(None, ( select_by_type, @@ -180,7 +217,7 @@ class SelectCardsetDialogWithPreview(MfxDialog): self.manager = manager self.key = key self.app = app - #padx, pady = kw.padx, kw.pady + # padx, pady = kw.padx, kw.pady padx, pady = 5, 5 if self.TreeDataHolder_Class.data is None: self.TreeDataHolder_Class.data = self.TreeData_Class(manager, key) @@ -211,9 +248,10 @@ class SelectCardsetDialogWithPreview(MfxDialog): left_frame, label=_('Scale X:'), from_=0.5, to=4.0, resolution=0.1, orient='horizontal', variable=var, - #value=app.opt.scale_x, + # value=app.opt.scale_x, command=self._updateScale) - self.scale_x.grid(row=1, column=0, sticky='ew', padx=padx, pady=pady) + self.scale_x.grid( + row=1, column=0, sticky='ew', padx=padx, pady=pady) # var = Tkinter.DoubleVar() var.set(app.opt.scale_y) @@ -221,9 +259,10 @@ class SelectCardsetDialogWithPreview(MfxDialog): left_frame, label=_('Scale Y:'), from_=0.5, to=4.0, resolution=0.1, orient='horizontal', variable=var, - #value=app.opt.scale_y, + # value=app.opt.scale_y, command=self._updateScale) - self.scale_y.grid(row=2, column=0, sticky='ew', padx=padx, pady=pady) + self.scale_y.grid( + row=2, column=0, sticky='ew', padx=padx, pady=pady) # self.auto_scale = Tkinter.BooleanVar() self.auto_scale.set(app.opt.auto_scale) @@ -242,7 +281,7 @@ class SelectCardsetDialogWithPreview(MfxDialog): left_frame, text=_('Preserve aspect ratio'), variable=self.preserve_aspect, takefocus=False, - #command=self._updateScale + # command=self._updateScale ) self.aspect_check.grid(row=4, column=0, sticky='w', padx=padx, pady=pady) @@ -304,9 +343,10 @@ class SelectCardsetDialogWithPreview(MfxDialog): cs = self.manager.get(self.tree.selection_key) if not cs: return - ##title = CARDSET+" "+cs.name + # title = CARDSET+" "+cs.name title = CARDSET.capitalize()+" "+cs.name - CardsetInfoDialog(self.top, title=title, cardset=cs, images=self.preview_images) + CardsetInfoDialog( + self.top, title=title, cardset=cs, images=self.preview_images) return MfxDialog.mDone(self, button) @@ -337,7 +377,7 @@ class SelectCardsetDialogWithPreview(MfxDialog): return names, columns = cs.getPreviewCardNames() try: - #???names, columns = cs.getPreviewCardNames() + # ???names, columns = cs.getPreviewCardNames() for n in names: f = os.path.join(cs.dir, n + cs.ext) self.preview_images.append(loadImage(file=f)) @@ -365,8 +405,8 @@ class SelectCardsetDialogWithPreview(MfxDialog): x = x + dx canvas.config(scrollregion=(0, 0, sx+dx, sy+dy), width=sx+dx, height=sy+dy) - #canvas.config(xscrollincrement=dx, yscrollincrement=dy) - canvas.event_generate('') # update bg image + # canvas.config(xscrollincrement=dx, yscrollincrement=dy) + canvas.event_generate('') # update bg image self.preview_key = key self.key = key @@ -380,6 +420,7 @@ class SelectCardsetByTypeDialogWithPreview(SelectCardsetDialogWithPreview): # * Cardset Info # ************************************************************************ + class CardsetInfoDialog(MfxDialog): def __init__(self, parent, title, cardset, images, **kw): kw = self.initKw(kw) @@ -403,14 +444,14 @@ class CardsetInfoDialog(MfxDialog): year = str(cardset.year) row = 0 for n, t in ( - ##('Version:', str(cardset.version)), + # ('Version:', str(cardset.version)), (_('Type:'), CSI.TYPE[cardset.type]), (_('Styles:'), styles), (_('Nationality:'), nationalities), (_('Year:'), year), - ##(_('Number of cards:'), str(cardset.ncards)), + # (_('Number of cards:'), str(cardset.ncards)), (_('Size:'), '%d x %d' % (cardset.CARDW, cardset.CARDH)), - ): + ): if t is not None: l = Tkinter.Label(info_frame, text=n, anchor='w', justify='left') @@ -436,7 +477,7 @@ class CardsetInfoDialog(MfxDialog): info_frame.rowconfigure(row, weight=1) except: pass - ##bg = top_frame["bg"] + # bg = top_frame["bg"] bg = 'white' text_w = Tkinter.Text(frame, bd=1, relief="sunken", wrap="word", padx=4, width=64, height=16, bg=bg) @@ -460,7 +501,7 @@ class CardsetInfoDialog(MfxDialog): text_w.config(state="disabled") # focus = self.createButtons(bottom_frame, kw) - #focus = text_w + # focus = text_w self.mainloop(focus, kw.timeout) def initKw(self, kw): @@ -473,5 +514,3 @@ class CardsetInfoDialog(MfxDialog): buttonpadx=10, buttonpady=5, ) return MfxDialog.initKw(self, kw) - - diff --git a/pysollib/tk/selectgame.py b/pysollib/tk/selectgame.py index 96931fce..ce53a693 100644 --- a/pysollib/tk/selectgame.py +++ b/pysollib/tk/selectgame.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- mode: python; coding: utf-8; -*- -# ---------------------------------------------------------------------------## +# --------------------------------------------------------------------------- # # Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer # Copyright (C) 2003 Mt. Hood Playing Card Co. @@ -19,7 +19,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# ---------------------------------------------------------------------------## +# --------------------------------------------------------------------------- # imports @@ -28,7 +28,7 @@ import Tkinter from UserList import UserList # PySol imports -from pysollib.mygettext import _, n_ +from pysollib.mygettext import _ from pysollib.mfxutil import destruct, Struct, KwStruct from pysollib.mfxutil import format_time from pysollib.gamedb import GI @@ -63,7 +63,7 @@ class SelectGameNode(SelectDialogTreeNode): for gi in self.tree.data.all_games_gi: if gi and self.select_func is None: # All games - ##name = '%s (%s)' % (gi.name, CSI.TYPE_NAME[gi.category]) + # name = '%s (%s)' % (gi.name, CSI.TYPE_NAME[gi.category]) name = gi.name node = SelectGameLeaf(self.tree, self, name, key=gi.id) contents.append(node) @@ -82,9 +82,10 @@ class SelectGameData(SelectDialogTreeData): def __init__(self, app): SelectDialogTreeData.__init__(self) self.all_games_gi = map(app.gdb.get, app.gdb.getGamesIdSortedByName()) - self.no_games = [ SelectGameLeaf(None, None, _("(no games)"), None), ] + self.no_games = [SelectGameLeaf(None, None, _("(no games)"), None), ] # - s_by_type = s_oriental = s_special = s_original = s_contrib = s_mahjongg = None + s_by_type = s_oriental = s_special = s_original = s_contrib = \ + s_mahjongg = None g = [] for data in (GI.SELECT_GAME_BY_TYPE, GI.SELECT_ORIENTAL_GAME_BY_TYPE, @@ -98,7 +99,10 @@ class SelectGameData(SelectDialogTreeData): continue gg.append(SelectGameNode(None, _(name), select_func)) g.append(gg) - select_mahjongg_game = lambda gi: gi.si.game_type == GI.GT_MAHJONGG + + def select_mahjongg_game(gi): + return gi.si.game_type == GI.GT_MAHJONGG + gg = None if filter(select_mahjongg_game, self.all_games_gi): gg = SelectGameNode(None, _("Mahjongg Games"), @@ -116,14 +120,15 @@ class SelectGameData(SelectDialogTreeData): if g[3]: s_original = SelectGameNode(None, _("Original Games"), tuple(g[3])) -## if g[4]: -## s_contrib = SelectGameNode(None, "Contributed Games", tuple(g[4])) + # if g[4]: + # s_contrib = SelectGameNode(None, "Contributed Games", tuple(g[4])) if g[5]: s_mahjongg = g[5] # s_by_compatibility, gg = None, [] for name, games in GI.GAMES_BY_COMPATIBILITY: - select_func = lambda gi, games=games: gi.id in games + def select_func(gi, games=games): + return gi.id in games if name is None or not filter(select_func, self.all_games_gi): continue gg.append(SelectGameNode(None, name, select_func)) @@ -134,9 +139,10 @@ class SelectGameData(SelectDialogTreeData): # s_by_pysol_version, gg = None, [] for name, games in GI.GAMES_BY_PYSOL_VERSION: - select_func = lambda gi, games=games: gi.id in games + def select_func(gi, games=games): + return gi.id in games if name is None or not filter(select_func, self.all_games_gi): - continue + continue name = _("New games in v. ") + name gg.append(SelectGameNode(None, name, select_func)) if 1 and gg: @@ -144,15 +150,17 @@ class SelectGameData(SelectDialogTreeData): tuple(gg)) s_by_inventors, gg = None, [] for name, games in GI.GAMES_BY_INVENTORS: - select_func = lambda gi, games=games: gi.id in games + def select_func(gi, games=games): + return gi.id in games if name is None or not filter(select_func, self.all_games_gi): - continue + continue gg.append(SelectGameNode(None, name, select_func)) if 1 and gg: s_by_inventors = SelectGameNode(None, _("by Inventors"), tuple(gg)) # - ul_alternate_names = UserList(list(app.gdb.getGamesTuplesSortedByAlternateName())) + ul_alternate_names = UserList( + list(app.gdb.getGamesTuplesSortedByAlternateName())) # self.rootnodes = filter(None, ( SelectGameNode(None, _("All Games"), None), @@ -172,8 +180,9 @@ class SelectGameData(SelectDialogTreeData): lambda gi: gi.skill_level == GI.SL_MOSTLY_LUCK), SelectGameNode(None, _('Balanced'), lambda gi: gi.skill_level == GI.SL_BALANCED), - SelectGameNode(None, _('Mostly skill'), - lambda gi: gi.skill_level == GI.SL_MOSTLY_SKILL), + SelectGameNode( + None, _('Mostly skill'), + lambda gi: gi.skill_level == GI.SL_MOSTLY_SKILL), SelectGameNode(None, _('Skill only'), lambda gi: gi.skill_level == GI.SL_SKILL), )), @@ -193,8 +202,10 @@ class SelectGameData(SelectDialogTreeData): lambda gi: gi.si.ncards == 104), SelectGameNode(None, _("144 cards"), lambda gi: gi.si.ncards == 144), - SelectGameNode(None, _("Other number"), - lambda gi: gi.si.ncards not in (32, 48, 52, 64, 78, 104, 144)), + SelectGameNode( + None, _("Other number"), + lambda gi: gi.si.ncards not in (32, 48, 52, + 64, 78, 104, 144)), )), SelectGameNode(None, _("by Number of Decks"), ( SelectGameNode(None, _("1 deck games"), @@ -219,8 +230,9 @@ class SelectGameData(SelectDialogTreeData): lambda gi: gi.si.redeals == -1), SelectGameNode(None, "Variable redeals", lambda gi: gi.si.redeals == -2), - SelectGameNode(None, _("Other number of redeals"), - lambda gi: gi.si.redeals not in (-1, 0, 1, 2, 3)), + SelectGameNode( + None, _("Other number of redeals"), + lambda gi: gi.si.redeals not in (-1, 0, 1, 2, 3)), )), s_by_compatibility, )), @@ -231,8 +243,9 @@ class SelectGameData(SelectDialogTreeData): lambda gi: gi.si.game_flags & GI.GT_CHILDREN), SelectGameNode(None, _("Games with Scoring"), lambda gi: gi.si.game_flags & GI.GT_SCORE), - SelectGameNode(None, _("Games with Separate Decks"), - lambda gi: gi.si.game_flags & GI.GT_SEPARATE_DECKS), + SelectGameNode( + None, _("Games with Separate Decks"), + lambda gi: gi.si.game_flags & GI.GT_SEPARATE_DECKS), SelectGameNode(None, _("Open Games (all cards visible)"), lambda gi: gi.si.game_flags & GI.GT_OPEN), SelectGameNode(None, _("Relaxed Variants"), @@ -348,10 +361,10 @@ class SelectGameDialogWithPreview(SelectGameDialog): w1, w2 = 220, 480 else: w1, w2 = 200, 300 - ##print sw, w1, w2 + # print sw, w1, w2 w2 = max(200, min(w2, 10 + 12*(app.subsampled_images.CARDW+10))) - ##print sw, w1, w2 - ##padx, pady = kw.padx, kw.pady + # print sw, w1, w2 + # padx, pady = kw.padx, kw.pady padx, pady = kw.padx/2, kw.pady/2 # PanedWindow paned_window = Tkinter.PanedWindow(top_frame) @@ -374,7 +387,6 @@ class SelectGameDialogWithPreview(SelectGameDialog): ipadx=padx, ipady=pady, sticky='nws') # Info self.info_labels = {} - i = 0 for n, t, f, row in ( ('name', _('Name:'), info_frame, 0), ('altnames', _('Alternate names:'), info_frame, 1), @@ -390,13 +402,13 @@ class SelectGameDialogWithPreview(SelectGameDialog): ('time', _('Playing time:'), stats_frame, 3), ('moves', _('Moves:'), stats_frame, 4), ('percent', _('% won:'), stats_frame, 5), - ): + ): title_label = Tkinter.Label(f, text=t, justify='left', anchor='w') title_label.grid(row=row, column=0, sticky='nw') text_label = Tkinter.Label(f, justify='left', anchor='w') text_label.grid(row=row, column=1, sticky='nw') self.info_labels[n] = (title_label, text_label) - ##info_frame.columnconfigure(1, weight=1) + # info_frame.columnconfigure(1, weight=1) info_frame.rowconfigure(6, weight=1) stats_frame.rowconfigure(6, weight=1) # Canvas @@ -415,7 +427,7 @@ class SelectGameDialogWithPreview(SelectGameDialog): self.preview_game = None self.preview_app = None self.updatePreview(gameid, animations=0) - ##focus = self.tree.frame + # focus = self.tree.frame self.mainloop(focus, kw.timeout) def initKw(self, kw): @@ -439,7 +451,7 @@ class SelectGameDialogWithPreview(SelectGameDialog): if destroy: self.preview.canvas.delete("all") # - #for l in self.info_labels.values(): + # for l in self.info_labels.values(): # l.config(text='') # destruct the game if self.preview_game: @@ -467,25 +479,25 @@ class SelectGameDialogWithPreview(SelectGameDialog): if self.preview_app is None: self.preview_app = Struct( # variables - audio = self.app.audio, - canvas = canvas, - cardset = self.app.cardset.copy(), - comments = self.app.comments.new(), - gamerandom = self.app.gamerandom, - gdb = self.app.gdb, - gimages = self.app.gimages, - images = self.app.subsampled_images, - menubar = None, - miscrandom = self.app.miscrandom, - opt = self.app.opt.copy(), - startup_opt = self.app.startup_opt, - stats = self.app.stats.new(), - top = None, - top_cursor = self.app.top_cursor, - toolbar = None, + audio=self.app.audio, + canvas=canvas, + cardset=self.app.cardset.copy(), + comments=self.app.comments.new(), + gamerandom=self.app.gamerandom, + gdb=self.app.gdb, + gimages=self.app.gimages, + images=self.app.subsampled_images, + menubar=None, + miscrandom=self.app.miscrandom, + opt=self.app.opt.copy(), + startup_opt=self.app.startup_opt, + stats=self.app.stats.new(), + top=None, + top_cursor=self.app.top_cursor, + toolbar=None, # methods - constructGame = self.app.constructGame, - getFont = self.app.getFont, + constructGame=self.app.constructGame, + getFont=self.app.getFont, ) self.preview_app.opt.shadow = 0 self.preview_app.opt.shade = 0 @@ -497,7 +509,8 @@ class SelectGameDialogWithPreview(SelectGameDialog): if self.preview_game: self.preview_game.endGame() self.preview_game.destruct() - ##self.top.wm_title("Select Game - " + self.app.getGameTitleName(gameid)) + # self.top.wm_title("Select Game - " + + # self.app.getGameTitleName(gameid)) title = self.app.getGameTitleName(gameid) self.top.wm_title(_("Playable Preview - ") + title) # @@ -551,13 +564,19 @@ class SelectGameDialogWithPreview(SelectGameDialog): GI.SL_SKILL: _('Skill only'), } skill_level = sl.get(gi.skill_level) - if gi.redeals == -2: redeals = _('variable') - elif gi.redeals == -1: redeals = _('unlimited') - else: redeals = str(gi.redeals) + if gi.redeals == -2: + redeals = _('variable') + elif gi.redeals == -1: + redeals = _('unlimited') + else: + redeals = str(gi.redeals) # stats - won, lost, time, moves = self.app.stats.getFullStats(self.app.opt.player, gameid) - if won+lost > 0: percent = "%.1f" % (100.0*won/(won+lost)) - else: percent = "0.0" + won, lost, time, moves = self.app.stats.getFullStats( + self.app.opt.player, gameid) + if won+lost > 0: + percent = "%.1f" % (100.0*won/(won+lost)) + else: + percent = "0.0" time = format_time(time) moves = str(round(moves, 1)) for n, t in ( @@ -574,7 +593,7 @@ class SelectGameDialogWithPreview(SelectGameDialog): ('time', time), ('moves', moves), ('percent', percent), - ): + ): title_label, text_label = self.info_labels[n] if t in ('', None): title_label.grid_remove() @@ -583,4 +602,3 @@ class SelectGameDialogWithPreview(SelectGameDialog): title_label.grid() text_label.grid() text_label.config(text=t) - diff --git a/tests/style/py-flake8.t b/tests/style/py-flake8.t index 77f0739a..80de145e 100644 --- a/tests/style/py-flake8.t +++ b/tests/style/py-flake8.t @@ -27,7 +27,7 @@ my %skip = # my $cmd = shell_quote( 'flake8', '.' ); my $cmd = shell_quote( 'flake8', - grep { not exists $skip{$_} } glob('./*.py ./scripts/*.py ./tests/board_gen/*.py ./pysollib/*.py ./pysollib/[cmgpuw]*/{*/*.py,*.py} ./pysollib/tile/*.py ./pysollib/tk/[a-p]*.py ./pysollib/ui/tktile/*.py') ); + grep { not exists $skip{$_} } glob('./*.py ./scripts/*.py ./tests/board_gen/*.py ./pysollib/*.py ./pysollib/[cmgpuw]*/{*/*.py,*.py} ./pysollib/tile/*.py ./pysollib/tk/{[a-p],selectcardset,selectgame}*.py ./pysollib/ui/tktile/*.py') ); # TEST eq_or_diff( scalar(`$cmd`), '', "flake8 is happy with the code." );