diff --git a/pysollib/games/royalcotillion.py b/pysollib/games/royalcotillion.py index b010039f..df67c118 100644 --- a/pysollib/games/royalcotillion.py +++ b/pysollib/games/royalcotillion.py @@ -100,7 +100,7 @@ class RoyalCotillion(Game): x, y = l.XM + l.XS, self.height - l.YS s.talon = WasteTalonStack(x, y, self, max_rounds=1) l.createText(s.talon, "sw") - x = x + l.XS + x += l.XS s.waste = WasteStack(x, y, self) l.createText(s.waste, "se") @@ -156,22 +156,22 @@ class OddAndEven(RoyalCotillion): for i in range(4): s.foundations.append( self.Foundation_Class(x, y, self, i, dir=2, mod=13)) - x = x + l.XS + x += l.XS for i in range(4): s.foundations.append( self.Foundation_Class( x, y, self, i, dir=2, mod=13, base_rank=1)) - x = x + l.XS + x += l.XS for i in range(2): x, y, = l.XM + ((4, 3)[i])*l.XS, l.YM + (i+1)*l.YS for j in range((4, 5)[i]): s.reserves.append(ReserveStack(x, y, self, max_accept=0)) - x = x + l.XS + x += l.XS x, y = l.XM, self.height - l.YS s.talon = WasteTalonStack(x, y, self, max_rounds=2) l.createText(s.talon, "n") l.createRoundText(s.talon, 'nnn') - x = x + l.XS + x += l.XS s.waste = WasteStack(x, y, self) l.createText(s.waste, "n") @@ -319,17 +319,17 @@ class Alhambra(Game): for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i, max_move=0)) - x = x + l.XS + x += l.XS for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i, max_move=0, base_rank=KING, dir=-1)) - x = x + l.XS + x += l.XS x, y, = l.XM+(8-reserves)*l.XS//2, y+l.YS for i in range(reserves): stack = OpenStack(x, y, self, max_accept=0) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, l.YOFFSET s.reserves.append(stack) - x = x + l.XS + x += l.XS x, y = l.XM+(8-1-rows)*l.XS//2, self.height-l.YS s.talon = Alhambra_Talon(x, y, self, max_rounds=3) if rows == 1: @@ -680,7 +680,7 @@ class ThreePirates(Game): x, y, = l.XM+l.XS, l.YM for i in range(8): s.foundations.append(SS_FoundationStack(x, y, self, suit=i//2)) - x = x + l.XS + x += l.XS x, y, = l.XM, l.YM+l.YS for i in range(10): diff --git a/pysollib/kivy/menubar.py b/pysollib/kivy/menubar.py index d5675f1f..90118ee3 100644 --- a/pysollib/kivy/menubar.py +++ b/pysollib/kivy/menubar.py @@ -814,9 +814,9 @@ class OptionsMenuDialog(LMenuDialog): self.menubar.tkopt.cardbacks[i], bi, self.make_vars_command( self.menubar.mOptSetCardback, i)) - bi = bi + 1 + bi += 1 - i = i + 1 + i += 1 # ------------------------------------------- # Table background settings @@ -866,7 +866,7 @@ class OptionsMenuDialog(LMenuDialog): tm = self.app.tabletile_manager # cnt = tm.len() i = 1 - while 1: + while True: ti = tm.get(i) if ti is None: break @@ -874,7 +874,7 @@ class OptionsMenuDialog(LMenuDialog): ti.name, self.menubar.tkopt.tabletile, i, self.menubar.mOptTileSet) - i = i + 1 + i += 1 # ------------------------------------------- # Card view options diff --git a/pysollib/pysolgtk/tkstats.py b/pysollib/pysolgtk/tkstats.py index f74c3a6d..a00dab77 100644 --- a/pysollib/pysolgtk/tkstats.py +++ b/pysollib/pysolgtk/tkstats.py @@ -523,21 +523,19 @@ class Status_StatsDialog(MfxMessageDialog): # MfxDialog def __init__(self, parent, game): stats, gstats = game.stats, game.gstats w1 = w2 = '' - n = 0 - for s in game.s.foundations: - n = n + len(s.cards) + n = sum([len(s.cards) for s in game.s.foundations]) w1 = (_('Highlight piles: ') + str(stats.highlight_piles) + '\n' + _('Highlight cards: ') + str(stats.highlight_cards) + '\n' + _('Highlight same rank: ') + str(stats.highlight_samerank) + '\n') if game.s.talon: if game.gameinfo.redeals != 0: - w2 = w2 + _('\nRedeals: ') + str(game.s.talon.round - 1) - w2 = w2 + _('\nCards in Talon: ') + str(len(game.s.talon.cards)) + w2 += _('\nRedeals: ') + str(game.s.talon.round - 1) + w2 += _('\nCards in Talon: ') + str(len(game.s.talon.cards)) if game.s.waste and game.s.waste not in game.s.foundations: - w2 = w2 + _('\nCards in Waste: ') + str(len(game.s.waste.cards)) + w2 += _('\nCards in Waste: ') + str(len(game.s.waste.cards)) if game.s.foundations: - w2 = w2 + _('\nCards in Foundations: ') + str(n) + w2 += _('\nCards in Foundations: ') + str(n) # date = time.strftime('%Y-%m-%d %H:%M', time.localtime(game.gstats.start_time))