1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00
This commit is contained in:
Shlomi Fish 2017-09-18 15:37:05 +03:00
parent b887d6042b
commit 86b243ad53
5 changed files with 22 additions and 23 deletions

View file

@ -1460,10 +1460,10 @@ Please select a %s type %s.
print_err('fail _readCardsetConfig: %s %s' print_err('fail _readCardsetConfig: %s %s'
% (d, f1)) % (d, f1))
pass pass
except Exception as err: except Exception:
# traceback.print_exc() # traceback.print_exc()
pass pass
except EnvironmentError as ex: except EnvironmentError:
pass pass
# register cardsets # register cardsets
for obj in found: for obj in found:
@ -1514,7 +1514,7 @@ Please select a %s type %s.
if key not in t: if key not in t:
t[key] = 1 t[key] = 1
found.append((n, tile)) found.append((n, tile))
except EnvironmentError as ex: except EnvironmentError:
pass pass
# register tiles # register tiles
found.sort() found.sort()
@ -1559,7 +1559,7 @@ Please select a %s type %s.
if key not in t: if key not in t:
t[key] = 1 t[key] = 1
found.append((n, obj)) found.append((n, obj))
except EnvironmentError as ex: except EnvironmentError:
pass pass
# register songs # register songs
found.sort() found.sort()

View file

@ -2239,9 +2239,9 @@ Congratulations, you did it !
def _shallHighlightMatch_ACW(self, stack1, card1, stack2, card2): def _shallHighlightMatch_ACW(self, stack1, card1, stack2, card2):
# by alternate color with wrapping (only for french games) # by alternate color with wrapping (only for french games)
return (card1.color != card2.color return (card1.color != card2.color and
and ((card1.rank + 1) % 13 == card2.rank ((card1.rank + 1) % 13 == card2.rank or
or (card2.rank + 1) % 13 == card1.rank)) (card2.rank + 1) % 13 == card1.rank))
def _shallHighlightMatch_SS(self, stack1, card1, stack2, card2): def _shallHighlightMatch_SS(self, stack1, card1, stack2, card2):
# by same suit # by same suit
@ -2249,9 +2249,9 @@ Congratulations, you did it !
def _shallHighlightMatch_SSW(self, stack1, card1, stack2, card2): def _shallHighlightMatch_SSW(self, stack1, card1, stack2, card2):
# by same suit with wrapping (only for french games) # by same suit with wrapping (only for french games)
return (card1.suit == card2.suit return (card1.suit == card2.suit and
and ((card1.rank + 1) % 13 == card2.rank ((card1.rank + 1) % 13 == card2.rank or
or (card2.rank + 1) % 13 == card1.rank)) (card2.rank + 1) % 13 == card1.rank))
def _shallHighlightMatch_RK(self, stack1, card1, stack2, card2): def _shallHighlightMatch_RK(self, stack1, card1, stack2, card2):
# by rank # by rank
@ -2259,8 +2259,8 @@ Congratulations, you did it !
def _shallHighlightMatch_RKW(self, stack1, card1, stack2, card2): def _shallHighlightMatch_RKW(self, stack1, card1, stack2, card2):
# by rank with wrapping (only for french games) # by rank with wrapping (only for french games)
return ((card1.rank + 1) % 13 == card2.rank return ((card1.rank + 1) % 13 == card2.rank or
or (card2.rank + 1) % 13 == card1.rank) (card2.rank + 1) % 13 == card1.rank)
def _shallHighlightMatch_BO(self, stack1, card1, stack2, card2): def _shallHighlightMatch_BO(self, stack1, card1, stack2, card2):
# by any suit but own # by any suit but own
@ -2268,9 +2268,9 @@ Congratulations, you did it !
def _shallHighlightMatch_BOW(self, stack1, card1, stack2, card2): def _shallHighlightMatch_BOW(self, stack1, card1, stack2, card2):
# by any suit but own with wrapping (only for french games) # by any suit but own with wrapping (only for french games)
return (card1.suit != card2.suit return (card1.suit != card2.suit and
and ((card1.rank + 1) % 13 == card2.rank ((card1.rank + 1) % 13 == card2.rank or
or (card2.rank + 1) % 13 == card1.rank)) (card2.rank + 1) % 13 == card1.rank))
def _shallHighlightMatch_SC(self, stack1, card1, stack2, card2): def _shallHighlightMatch_SC(self, stack1, card1, stack2, card2):
# by same color # by same color
@ -2278,9 +2278,9 @@ Congratulations, you did it !
def _shallHighlightMatch_SCW(self, stack1, card1, stack2, card2): def _shallHighlightMatch_SCW(self, stack1, card1, stack2, card2):
# by same color with wrapping (only for french games) # by same color with wrapping (only for french games)
return (card1.color == card2.color return (card1.color == card2.color and
and ((card1.rank + 1) % 13 == card2.rank ((card1.rank + 1) % 13 == card2.rank or
or (card2.rank + 1) % 13 == card1.rank)) (card2.rank + 1) % 13 == card1.rank))
# #
# quick-play # quick-play

View file

@ -31,8 +31,7 @@ from pysollib.mfxutil import KwStruct
# Toolkit imports # Toolkit imports
from pysollib.tk.basetkmfxdialog import BaseTkMfxDialog from pysollib.tk.basetkmfxdialog import BaseTkMfxDialog
from pysollib.ui.tktile.solverdialog import BaseSolverDialog, solver_dialog, \ from pysollib.ui.tktile.solverdialog import BaseSolverDialog, solver_dialog
connect_game_solver_dialog, destroy_solver_dialog, reset_solver_dialog
if sys.version_info > (3,): if sys.version_info > (3,):

View file

@ -620,8 +620,8 @@ class Status_StatsDialog(MfxMessageDialog):
n = n + len(s.cards) n = n + len(s.cards)
w1 = (_("Highlight piles: ") + str(stats.highlight_piles) + "\n" + w1 = (_("Highlight piles: ") + str(stats.highlight_piles) + "\n" +
_("Highlight cards: ") + str(stats.highlight_cards) + "\n" + _("Highlight cards: ") + str(stats.highlight_cards) + "\n" +
_("Highlight same rank: ") + str(stats.highlight_samerank) _("Highlight same rank: ") + str(stats.highlight_samerank) +
+ "\n") "\n")
if game.s.talon: if game.s.talon:
if game.gameinfo.redeals != 0: if game.gameinfo.redeals != 0:
w2 = w2 + _("\nRedeals: ") + str(game.s.talon.round - 1) w2 = w2 + _("\nRedeals: ") + str(game.s.talon.round - 1)

View file

@ -44,7 +44,7 @@ while ( my $r = $tree->next_obj )
my $cmd = shell_quote( 'flake8', @filenames ); my $cmd = shell_quote( 'flake8', @filenames );
# diag("<$cmd>"); diag("<$cmd>");
# TEST # TEST
eq_or_diff( scalar(`$cmd`), '', "flake8 is happy with the code." ); eq_or_diff( scalar(`$cmd`), '', "flake8 is happy with the code." );