mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
flake8
This commit is contained in:
parent
31cb034400
commit
6a65e9f1c7
2 changed files with 19 additions and 11 deletions
|
@ -22,7 +22,7 @@
|
|||
# ---------------------------------------------------------------------------##
|
||||
|
||||
__all__ = [
|
||||
#'SolverDialog',
|
||||
# 'SolverDialog',
|
||||
'create_solver_dialog',
|
||||
'connect_game_solver_dialog',
|
||||
'destroy_solver_dialog',
|
||||
|
@ -30,28 +30,37 @@ __all__ = [
|
|||
]
|
||||
|
||||
# imports
|
||||
import sys
|
||||
import Tkinter
|
||||
|
||||
# PySol imports
|
||||
from pysollib.mygettext import _, n_
|
||||
from pysollib.mygettext import _
|
||||
from pysollib.mfxutil import KwStruct
|
||||
|
||||
# Toolkit imports
|
||||
from pysollib.tk.basetkmfxdialog import BaseTkMfxDialog
|
||||
from pysollib.ui.tktile.solverdialog import BaseSolverDialog, solver_dialog, connect_game_solver_dialog, destroy_solver_dialog, reset_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,):
|
||||
xrange = range
|
||||
|
||||
|
||||
# ************************************************************************
|
||||
# *
|
||||
# ************************************************************************
|
||||
|
||||
solver_dialog = solver_dialog
|
||||
|
||||
|
||||
class SolverDialog(BaseSolverDialog, BaseTkMfxDialog):
|
||||
def _createGamesVar(self, frame, row):
|
||||
var = Tkinter.StringVar()
|
||||
om = Tkinter.OptionMenu(frame, var, command=self.gameSelected,
|
||||
*(self.gamenames))
|
||||
om.grid(row=row, column=1, sticky='ew', padx=2, pady=2)
|
||||
n = len(gamenames)
|
||||
n = len(self.gamenames)
|
||||
cb_max = int(self.top.winfo_screenheight()/23)
|
||||
cb_max = n / (n/cb_max+1)
|
||||
for i in xrange(cb_max, n, cb_max):
|
||||
|
@ -66,11 +75,12 @@ class SolverDialog(BaseSolverDialog, BaseTkMfxDialog):
|
|||
return var
|
||||
|
||||
def _createShowProgressButton(self, frame):
|
||||
return self._calcToolkit().Checkbutton(frame, variable=self.progress_var,
|
||||
text=_('Show progress'), anchor='w')
|
||||
return self._calcToolkit().Checkbutton(
|
||||
frame, variable=self.progress_var,
|
||||
text=_('Show progress'), anchor='w')
|
||||
|
||||
def initKw(self, kw):
|
||||
strings=[_('&Start'), _('&Play'), _('&New'), _('&Close'),]
|
||||
strings = [_('&Start'), _('&Play'), _('&New'), _('&Close'), ]
|
||||
kw = KwStruct(kw,
|
||||
strings=strings,
|
||||
default=0,
|
||||
|
@ -88,13 +98,11 @@ class SolverDialog(BaseSolverDialog, BaseTkMfxDialog):
|
|||
self.play_button.config(state='disabled')
|
||||
|
||||
|
||||
|
||||
def create_solver_dialog(parent, game):
|
||||
global solver_dialog
|
||||
try:
|
||||
solver_dialog.top.wm_deiconify()
|
||||
solver_dialog.top.tkraise()
|
||||
except:
|
||||
##traceback.print_exc()
|
||||
# traceback.print_exc()
|
||||
solver_dialog = SolverDialog(parent, game)
|
||||
|
||||
|
|
|
@ -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],select}*.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],select,solv}*.py ./pysollib/ui/tktile/*.py') );
|
||||
|
||||
# TEST
|
||||
eq_or_diff( scalar(`$cmd`), '', "flake8 is happy with the code." );
|
||||
|
|
Loading…
Add table
Reference in a new issue