mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
flake8
This commit is contained in:
parent
7f7f1669ad
commit
e3e3f75068
2 changed files with 11 additions and 9 deletions
|
@ -25,11 +25,12 @@ __all__ = ['WizardDialog']
|
||||||
|
|
||||||
|
|
||||||
# imports
|
# imports
|
||||||
|
import sys
|
||||||
import Tkinter
|
import Tkinter
|
||||||
from tabpage import TabPageSet
|
from tabpage import TabPageSet
|
||||||
|
|
||||||
# PySol imports
|
# PySol imports
|
||||||
from pysollib.mygettext import _, n_
|
from pysollib.mygettext import _
|
||||||
from pysollib.mfxutil import KwStruct
|
from pysollib.mfxutil import KwStruct
|
||||||
from pysollib.wizardutil import WizardWidgets
|
from pysollib.wizardutil import WizardWidgets
|
||||||
from pysollib.wizardpresets import presets
|
from pysollib.wizardpresets import presets
|
||||||
|
@ -38,6 +39,10 @@ from pysollib.wizardpresets import presets
|
||||||
from tkwidget import MfxDialog
|
from tkwidget import MfxDialog
|
||||||
|
|
||||||
|
|
||||||
|
if sys.version_info > (3,):
|
||||||
|
basestring = str
|
||||||
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# *
|
# *
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
@ -58,7 +63,7 @@ class WizardDialog(MfxDialog):
|
||||||
|
|
||||||
for w in WizardWidgets:
|
for w in WizardWidgets:
|
||||||
if isinstance(w, basestring):
|
if isinstance(w, basestring):
|
||||||
p = notebook.AddPage(w)
|
notebook.AddPage(w)
|
||||||
frame = Tkinter.Frame(notebook.pages[w]['page'])
|
frame = Tkinter.Frame(notebook.pages[w]['page'])
|
||||||
frame.pack(expand=True, fill='both', padx=2, pady=4)
|
frame.pack(expand=True, fill='both', padx=2, pady=4)
|
||||||
frame.columnconfigure(1, weight=1)
|
frame.columnconfigure(1, weight=1)
|
||||||
|
@ -75,7 +80,9 @@ class WizardDialog(MfxDialog):
|
||||||
values.remove(default)
|
values.remove(default)
|
||||||
values.sort()
|
values.sort()
|
||||||
values.insert(0, default)
|
values.insert(0, default)
|
||||||
callback = lambda v, w=w: self.presetSelected(v, w)
|
|
||||||
|
def callback(v, w=w):
|
||||||
|
return self.presetSelected(v, w)
|
||||||
om = Tkinter.OptionMenu(frame, w.variable,
|
om = Tkinter.OptionMenu(frame, w.variable,
|
||||||
command=callback, *values)
|
command=callback, *values)
|
||||||
om.grid(row=row, column=1, sticky='ew', padx=2)
|
om.grid(row=row, column=1, sticky='ew', padx=2)
|
||||||
|
@ -120,7 +127,6 @@ class WizardDialog(MfxDialog):
|
||||||
focus = self.createButtons(bottom_frame, kw)
|
focus = self.createButtons(bottom_frame, kw)
|
||||||
self.mainloop(focus, kw.timeout)
|
self.mainloop(focus, kw.timeout)
|
||||||
|
|
||||||
|
|
||||||
def presetSelected(self, v, w):
|
def presetSelected(self, v, w):
|
||||||
n = w.translation_map[v]
|
n = w.translation_map[v]
|
||||||
p = presets[n]
|
p = presets[n]
|
||||||
|
@ -135,7 +141,6 @@ class WizardDialog(MfxDialog):
|
||||||
v = _(v)
|
v = _(v)
|
||||||
w.variable.set(v)
|
w.variable.set(v)
|
||||||
|
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_('&OK'), _('&Cancel')),
|
strings=(_('&OK'), _('&Cancel')),
|
||||||
|
@ -143,6 +148,3 @@ class WizardDialog(MfxDialog):
|
||||||
separator=False,
|
separator=False,
|
||||||
)
|
)
|
||||||
return MfxDialog.initKw(self, kw)
|
return MfxDialog.initKw(self, kw)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ my %skip =
|
||||||
|
|
||||||
# my $cmd = shell_quote( 'flake8', '.' );
|
# my $cmd = shell_quote( 'flake8', '.' );
|
||||||
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-s]}*.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-sw]}*.py ./pysollib/ui/tktile/*.py') );
|
||||||
|
|
||||||
# TEST
|
# TEST
|
||||||
eq_or_diff( scalar(`$cmd`), '', "flake8 is happy with the code." );
|
eq_or_diff( scalar(`$cmd`), '', "flake8 is happy with the code." );
|
||||||
|
|
Loading…
Add table
Reference in a new issue