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-04-16 22:40:56 +03:00
parent c4b882e1e1
commit 8c4887b70b
3 changed files with 133 additions and 107 deletions

View file

@ -1,38 +1,37 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*- # -*- mode: python; coding: utf-8; -*-
##---------------------------------------------------------------------------## # ---------------------------------------------------------------------------##
## #
## Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer # Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
## Copyright (C) 2003 Mt. Hood Playing Card Co. # Copyright (C) 2003 Mt. Hood Playing Card Co.
## Copyright (C) 2005-2009 Skomoroh # Copyright (C) 2005-2009 Skomoroh
## #
## This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version. # (at your option) any later version.
## #
## This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details. # GNU General Public License for more details.
## #
## You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
## #
##---------------------------------------------------------------------------## # ---------------------------------------------------------------------------##
# imports # imports
import os import os
import traceback
# PySol imports # PySol imports
from pysollib.resource import CSI from pysollib.resource import CSI
from pysollib.settings import TOOLKIT
from pysollib.mfxutil import Image, ImageTk, USE_PIL from pysollib.mfxutil import Image, ImageTk, USE_PIL
# Toolkit imports # Toolkit imports
from pysollib.pysoltk import loadImage, copyImage, createImage, shadowImage, createBottom, resizeBottom from pysollib.pysoltk import loadImage, copyImage, createImage, \
shadowImage, createBottom
# ************************************************************************ # ************************************************************************
# * Images # * Images
@ -41,7 +40,8 @@ from pysollib.pysoltk import loadImage, copyImage, createImage, shadowImage, cre
class ImagesCardback: class ImagesCardback:
def __init__(self, index, name, image, menu_image=None): def __init__(self, index, name, image, menu_image=None):
if menu_image is None: menu_image = image if menu_image is None:
menu_image = image
self.index = index self.index = index
self.name = name self.name = name
self.image = image self.image = image
@ -60,14 +60,16 @@ class Images:
self._setSize() self._setSize()
self._card = [] self._card = []
self._back = [] self._back = []
self._bottom = [] # bottom of stack (link to _bottom_negative/_bottom_positive) # bottom of stack (link to _bottom_negative/_bottom_positive)
self._bottom = []
self._bottom_negative = [] # negative bottom of stack (white) self._bottom_negative = [] # negative bottom of stack (white)
self._bottom_positive = [] # positive bottom of stack (black) self._bottom_positive = [] # positive bottom of stack (black)
self._blank_bottom = None # blank (transparent) bottom of stack self._blank_bottom = None # blank (transparent) bottom of stack
self._letter = [] # images of letter self._letter = [] # images of letter
self._letter_negative = [] self._letter_negative = []
self._letter_positive = [] self._letter_positive = []
self._shadow = [] # vertical shadow of card (used when we drag a card) # vertical shadow of card (used when we drag a card)
self._shadow = []
self._xshadow = [] # horizontal shadow of card self._xshadow = [] # horizontal shadow of card
self._pil_shadow = {} # key: (width, height) self._pil_shadow = {} # key: (width, height)
self._highlight = [] # highlight of card (tip) self._highlight = [] # highlight of card (tip)
@ -78,7 +80,7 @@ class Images:
pass pass
def __loadCard(self, filename, check_w=1, check_h=1): def __loadCard(self, filename, check_w=1, check_h=1):
##print '__loadCard:', filename # print '__loadCard:', filename
f = os.path.join(self.cs.dir, filename) f = os.path.join(self.cs.dir, filename)
if not os.path.exists(f): if not os.path.exists(f):
return None return None
@ -91,7 +93,7 @@ class Images:
self.CARDW, self.CARDH = w, h self.CARDW, self.CARDH = w, h
else: else:
if ((check_w and w != self.CARDW) or if ((check_w and w != self.CARDW) or
(check_h and h != self.CARDH)): (check_h and h != self.CARDH)):
raise ValueError("Invalid size %dx%d of image %s" % (w, h, f)) raise ValueError("Invalid size %dx%d of image %s" % (w, h, f))
return img return img
@ -107,7 +109,8 @@ class Images:
# load image # load image
img = self.__loadCard(filename+self.cs.ext, check_w, check_h) img = self.__loadCard(filename+self.cs.ext, check_w, check_h)
if USE_PIL: if USE_PIL:
# we have no bottom images (data/images/cards/bottoms/<cs_type>) # we have no bottom images
# (data/images/cards/bottoms/<cs_type>)
img = img.resize(self._xfactor, self._yfactor) img = img.resize(self._xfactor, self._yfactor)
return img return img
# create image # create image
@ -158,56 +161,70 @@ class Images:
ext = self.cs.ext[1:] ext = self.cs.ext[1:]
pstep = 0 pstep = 0
if progress: if progress:
pstep = self.cs.ncards + len(self.cs.backnames) + self.cs.nbottoms + self.cs.nletters pstep = self.cs.ncards + len(self.cs.backnames) + \
pstep += self.cs.nshadows + 1 # shadows & shade self.cs.nbottoms + self.cs.nletters
pstep += self.cs.nshadows + 1 # shadows & shade
pstep = max(0, (80.0 - progress.percent) / pstep) pstep = max(0, (80.0 - progress.percent) / pstep)
# load face cards # load face cards
for n in self.cs.getFaceCardNames(): for n in self.cs.getFaceCardNames():
self._card.append(self.__loadCard(n + self.cs.ext)) self._card.append(self.__loadCard(n + self.cs.ext))
self._card[-1].filename = n self._card[-1].filename = n
if progress: progress.update(step=pstep) if progress:
progress.update(step=pstep)
assert len(self._card) == self.cs.ncards assert len(self._card) == self.cs.ncards
# load backgrounds # load backgrounds
for name in self.cs.backnames: for name in self.cs.backnames:
if name: if name:
im = self.__loadCard(name) im = self.__loadCard(name)
self.__addBack(im, name) self.__addBack(im, name)
if progress: progress.update(step=1) if progress:
progress.update(step=1)
# load bottoms # load bottoms
for i in range(self.cs.nbottoms): for i in range(self.cs.nbottoms):
name = "bottom%02d" % (i + 1) name = "bottom%02d" % (i + 1)
self._bottom_positive.append(self.__loadBottom(name, color='black')) self._bottom_positive.append(
if progress: progress.update(step=pstep) self.__loadBottom(name, color='black'))
if progress:
progress.update(step=pstep)
# load negative bottoms # load negative bottoms
name = "bottom%02d-n" % (i + 1) name = "bottom%02d-n" % (i + 1)
self._bottom_negative.append(self.__loadBottom(name, color='white')) self._bottom_negative.append(
if progress: progress.update(step=pstep) self.__loadBottom(name, color='white'))
if progress:
progress.update(step=pstep)
# load letters # load letters
for rank in range(self.cs.nletters): for rank in range(self.cs.nletters):
name = "l%02d" % (rank + 1) name = "l%02d" % (rank + 1)
self._letter_positive.append(self.__loadBottom(name, color='black')) self._letter_positive.append(
if progress: progress.update(step=pstep) self.__loadBottom(name, color='black'))
if progress:
progress.update(step=pstep)
# load negative letters # load negative letters
name = "l%02d-n" % (rank + 1) name = "l%02d-n" % (rank + 1)
self._letter_negative.append(self.__loadBottom(name, color='white')) self._letter_negative.append(
if progress: progress.update(step=pstep) self.__loadBottom(name, color='white'))
if progress:
progress.update(step=pstep)
# shadow # shadow
if not USE_PIL: if not USE_PIL:
for i in range(self.cs.nshadows): for i in range(self.cs.nshadows):
name = "shadow%02d.%s" % (i, ext) name = "shadow%02d.%s" % (i, ext)
im = self.__loadCard(name, check_w=0, check_h=0) im = self.__loadCard(name, check_w=0, check_h=0)
self._shadow.append(im) self._shadow.append(im)
if i > 0: # skip 0 if i > 0: # skip 0
name = "xshadow%02d.%s" % (i, ext) name = "xshadow%02d.%s" % (i, ext)
im = self.__loadCard(name, check_w=0, check_h=0) im = self.__loadCard(name, check_w=0, check_h=0)
self._xshadow.append(im) self._xshadow.append(im)
if progress: progress.update(step=pstep) if progress:
progress.update(step=pstep)
# shade # shade
if USE_PIL: if USE_PIL:
self._highlight.append(self._getHighlight(self._card[0], None, '#3896f8')) self._highlight.append(
self._getHighlight(self._card[0], None, '#3896f8'))
else: else:
self._highlight.append(self.__loadCard("shade." + ext)) self._highlight.append(self.__loadCard("shade." + ext))
if progress: progress.update(step=pstep) if progress:
progress.update(step=pstep)
# create missing # create missing
self._createMissingImages() self._createMissingImages()
# #
@ -218,7 +235,7 @@ class Images:
def getFace(self, deck, suit, rank): def getFace(self, deck, suit, rank):
index = suit * len(self.cs.ranks) + rank index = suit * len(self.cs.ranks) + rank
##print "getFace:", suit, rank, index # print "getFace:", suit, rank, index
return self._card[index % self.cs.ncards] return self._card[index % self.cs.ncards]
def getBack(self, update=False): def getBack(self, update=False):
@ -238,7 +255,8 @@ class Images:
def getSuitBottom(self, suit=-1): def getSuitBottom(self, suit=-1):
assert isinstance(suit, int) assert isinstance(suit, int)
if suit == -1: return self._bottom[1] # any suit if suit == -1:
return self._bottom[1] # any suit
i = 3 + suit i = 3 + suit
if i >= len(self._bottom): if i >= len(self._bottom):
# Trump (for Tarock type games) # Trump (for Tarock type games)
@ -257,7 +275,7 @@ class Images:
def getShadow(self, ncards): def getShadow(self, ncards):
if ncards >= 0: if ncards >= 0:
if ncards >= len(self._shadow): if ncards >= len(self._shadow):
##ncards = len(self._shadow) - 1 # ncards = len(self._shadow) - 1
return None return None
return self._shadow[ncards] return self._shadow[ncards]
else: else:
@ -275,8 +293,8 @@ class Images:
x1 += cw x1 += cw
y1 += ch y1 += ch
w, h = x1-x0, y1-y0 w, h = x1-x0, y1-y0
if (w,h) in self._pil_shadow: if (w, h) in self._pil_shadow:
return self._pil_shadow[(w,h)] return self._pil_shadow[(w, h)]
# create mask # create mask
mask = Image.new('RGBA', (w, h)) mask = Image.new('RGBA', (w, h))
for c in cards: for c in cards:
@ -285,15 +303,15 @@ class Images:
im = c._active_image._pil_image im = c._active_image._pil_image
mask.paste(im, (x, y), im) mask.paste(im, (x, y), im)
# create shadow # create shadow
sh_color = (0x00,0x00,0x00,0x50) sh_color = (0x00, 0x00, 0x00, 0x50)
shadow = Image.new('RGBA', (w, h)) shadow = Image.new('RGBA', (w, h))
shadow.paste(sh_color, (0, 0, w, h), mask) shadow.paste(sh_color, (0, 0, w, h), mask)
sx, sy = self.SHADOW_XOFFSET, self.SHADOW_YOFFSET sx, sy = self.SHADOW_XOFFSET, self.SHADOW_YOFFSET
mask = mask.crop((sx,sy,w,h)) mask = mask.crop((sx, sy, w, h))
tmp = Image.new('RGBA', (w-sx,h-sy)) tmp = Image.new('RGBA', (w-sx, h-sy))
shadow.paste(tmp, (0,0), mask) shadow.paste(tmp, (0, 0), mask)
shadow = ImageTk.PhotoImage(shadow) shadow = ImageTk.PhotoImage(shadow)
self._pil_shadow[(w,h)] = shadow self._pil_shadow[(w, h)] = shadow
return shadow return shadow
def getShade(self): def getShade(self):
@ -357,7 +375,7 @@ class Images:
self.CARD_DX, self.CARD_DY = cs.CARD_DX, cs.CARD_DY self.CARD_DX, self.CARD_DY = cs.CARD_DX, cs.CARD_DY
def _setSize(self, xf=1, yf=1): def _setSize(self, xf=1, yf=1):
#print 'image._setSize', xf, yf # print 'image._setSize', xf, yf
self._xfactor = xf self._xfactor = xf
self._yfactor = yf self._yfactor = yf
cs = self.cs cs = self.cs
@ -373,21 +391,23 @@ class Images:
def getSize(self): def getSize(self):
return (int(self.CARDW * self._xfactor), return (int(self.CARDW * self._xfactor),
int(self.CARDH * self._yfactor)) int(self.CARDH * self._yfactor))
def getOffsets(self): def getOffsets(self):
return (int(self.CARD_XOFFSET * self._xfactor), return (int(self.CARD_XOFFSET * self._xfactor),
int(self.CARD_YOFFSET * self._yfactor)) int(self.CARD_YOFFSET * self._yfactor))
def getDelta(self): def getDelta(self):
return (int(self.CARD_DX * self._xfactor), return (int(self.CARD_DX * self._xfactor),
int(self.CARD_DY * self._yfactor)) int(self.CARD_DY * self._yfactor))
def resize(self, xf, yf): def resize(self, xf, yf):
#print 'Images.resize:', xf, yf, self._card[0].width(), self.CARDW # print 'Images.resize:', xf, yf, self._card[0].width(), self.CARDW
if self._xfactor == xf and self._yfactor == yf: if self._xfactor == xf and self._yfactor == yf:
#print 'no resize' # print 'no resize'
return return
self._xfactor = xf self._xfactor = xf
self._yfactor = yf self._yfactor = yf
#???self._setSize(xf, yf) # ???self._setSize(xf, yf)
self.setOffsets() self.setOffsets()
# cards # cards
cards = [] cards = []
@ -404,27 +424,32 @@ class Images:
self._bottom_positive = [] self._bottom_positive = []
for i in range(self.cs.nbottoms): for i in range(self.cs.nbottoms):
name = "bottom%02d" % (i + 1) name = "bottom%02d" % (i + 1)
self._bottom_positive.append(self.__loadBottom(name, color='black')) self._bottom_positive.append(
self.__loadBottom(name, color='black'))
name = "bottom%02d-n" % (i + 1) name = "bottom%02d-n" % (i + 1)
self._bottom_negative.append(self.__loadBottom(name, color='white')) self._bottom_negative.append(
self.__loadBottom(name, color='white'))
# letters # letters
self._letter_positive = [] self._letter_positive = []
self._letter_negative = [] self._letter_negative = []
for rank in range(self.cs.nletters): for rank in range(self.cs.nletters):
name = "l%02d" % (rank + 1) name = "l%02d" % (rank + 1)
self._letter_positive.append(self.__loadBottom(name, color='black')) self._letter_positive.append(
self.__loadBottom(name, color='black'))
name = "l%02d-n" % (rank + 1) name = "l%02d-n" % (rank + 1)
self._letter_negative.append(self.__loadBottom(name, color='white')) self._letter_negative.append(
self.__loadBottom(name, color='white'))
self._createMissingImages() self._createMissingImages()
self.setNegative(neg) self.setNegative(neg)
# #
self._highlighted_images = {} self._highlighted_images = {}
self._highlight = [] self._highlight = []
self._highlight.append(self._getHighlight(self._card[0], None, '#3896f8')) self._highlight.append(
self._getHighlight(self._card[0], None, '#3896f8'))
self._pil_shadow = {} self._pil_shadow = {}
def reset(self): def reset(self):
print 'Image.reset' print('Image.reset')
self.resize(1, 1) self.resize(1, 1)
@ -448,11 +473,12 @@ class SubsampledImages(Images):
self._back.append(None) self._back.append(None)
else: else:
im = _back.image.subsample(r) im = _back.image.subsample(r)
self._back.append(ImagesCardback(len(self._back), _back.name, im, im)) self._back.append(
ImagesCardback(len(self._back), _back.name, im, im))
# #
CW, CH = self.CARDW, self.CARDH CW, CH = self.CARDW, self.CARDH
for im in images._highlight: for im in images._highlight:
##self._highlight.append(None) # self._highlight.append(None)
self._highlight.append(copyImage(im, 0, 0, CW, CH)) self._highlight.append(copyImage(im, 0, 0, CW, CH))
def getShadow(self, ncards): def getShadow(self, ncards):
@ -466,4 +492,3 @@ class SubsampledImages(Images):
else: else:
s.append(im.subsample(r)) s.append(im.subsample(r))
return s return s

View file

@ -1,30 +1,31 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*- # -*- mode: python; coding: utf-8; -*-
##---------------------------------------------------------------------------## # ---------------------------------------------------------------------------##
## #
## Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer # Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
## Copyright (C) 2003 Mt. Hood Playing Card Co. # Copyright (C) 2003 Mt. Hood Playing Card Co.
## Copyright (C) 2005-2009 Skomoroh # Copyright (C) 2005-2009 Skomoroh
## #
## This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version. # (at your option) any later version.
## #
## This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details. # GNU General Public License for more details.
## #
## You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
## #
##---------------------------------------------------------------------------## # ---------------------------------------------------------------------------##
import sys, os, locale, subprocess import sys
import traceback import os
import locale
import subprocess
from pysollib.mygettext import _, n_
import gettext import gettext
import pysollib.settings import pysollib.settings
@ -41,10 +42,10 @@ def init():
os.environ['LANG'] = l[0] os.environ['LANG'] = l[0]
except: except:
pass pass
##locale.setlocale(locale.LC_ALL, '') # locale.setlocale(locale.LC_ALL, '')
## install gettext # install gettext
##locale_dir = 'locale' # locale_dir = 'locale'
locale_dir = None locale_dir = None
if os.path.isdir(sys.path[0]): if os.path.isdir(sys.path[0]):
d = os.path.join(sys.path[0], 'locale') d = os.path.join(sys.path[0], 'locale')
@ -53,23 +54,23 @@ def init():
d = os.path.join(os.path.dirname(sys.path[0]), 'locale') d = os.path.join(os.path.dirname(sys.path[0]), 'locale')
if os.path.exists(d) and os.path.isdir(d): if os.path.exists(d) and os.path.isdir(d):
locale_dir = d locale_dir = d
##if locale_dir: locale_dir = os.path.normpath(locale_dir) # if locale_dir: locale_dir = os.path.normpath(locale_dir)
#gettext.install('pysol', locale_dir, unicode=True) # ngettext don't work # gettext.install('pysol', locale_dir, unicode=True) # ngettext don't work
gettext.bindtextdomain('pysol', locale_dir) gettext.bindtextdomain('pysol', locale_dir)
gettext.textdomain('pysol') gettext.textdomain('pysol')
## debug # debug
if 'PYSOL_CHECK_GAMES' in os.environ or 'PYSOL_DEBUG' in os.environ: if 'PYSOL_CHECK_GAMES' in os.environ or 'PYSOL_DEBUG' in os.environ:
pysollib.settings.CHECK_GAMES = True pysollib.settings.CHECK_GAMES = True
print 'PySol debugging: set CHECK_GAMES to True' print('PySol debugging: set CHECK_GAMES to True')
if 'PYSOL_DEBUG' in os.environ: if 'PYSOL_DEBUG' in os.environ:
try: try:
pysollib.settings.DEBUG = int(os.environ['PYSOL_DEBUG']) pysollib.settings.DEBUG = int(os.environ['PYSOL_DEBUG'])
except: except:
pysollib.settings.DEBUG = 1 pysollib.settings.DEBUG = 1
print 'PySol debugging: set DEBUG to', pysollib.settings.DEBUG print('PySol debugging: set DEBUG to', pysollib.settings.DEBUG)
## init toolkit # init toolkit
if '--gtk' in sys.argv: if '--gtk' in sys.argv:
pysollib.settings.TOOLKIT = 'gtk' pysollib.settings.TOOLKIT = 'gtk'
sys.argv.remove('--gtk') sys.argv.remove('--gtk')
@ -106,16 +107,17 @@ def init():
else: else:
pysollib.settings.USE_TILE = True pysollib.settings.USE_TILE = True
# "can't invoke event <<ThemeChanged>>: application has been destroyed" # "can't invoke event <<ThemeChanged>>: application has been destroyed"
#root.destroy() # root.destroy()
Tkinter._default_root = None Tkinter._default_root = None
# check FreeCell-Solver # check FreeCell-Solver
pysollib.settings.USE_FREECELL_SOLVER = False pysollib.settings.USE_FREECELL_SOLVER = False
if os.name == 'nt': if os.name == 'nt':
if sys.path[0] and not os.path.isdir(sys.path[0]): # i.e. library.zip if sys.path[0] and not os.path.isdir(sys.path[0]): # i.e. library.zip
d = os.path.dirname(sys.path[0]) d = os.path.dirname(sys.path[0])
os.chdir(d) # for read presets os.chdir(d) # for read presets
fcs_command = os.path.join('freecell-solver', 'bin', 'fc-solve.exe') fcs_command = os.path.join(
'freecell-solver', 'bin', 'fc-solve.exe')
pysollib.settings.FCS_COMMAND = fcs_command pysollib.settings.FCS_COMMAND = fcs_command
f = os.path.join('freecell-solver', 'presetrc') f = os.path.join('freecell-solver', 'presetrc')
os.environ['FREECELL_SOLVER_PRESETRC'] = f os.environ['FREECELL_SOLVER_PRESETRC'] = f
@ -124,7 +126,7 @@ def init():
kw = {'shell': True, kw = {'shell': True,
'stdout': subprocess.PIPE, 'stdout': subprocess.PIPE,
'stderr': subprocess.PIPE, 'stderr': subprocess.PIPE,
'stdin': subprocess.PIPE,} 'stdin': subprocess.PIPE, }
if os.name != 'nt': if os.name != 'nt':
kw['close_fds'] = True kw['close_fds'] = True
p = subprocess.Popen(pysollib.settings.FCS_COMMAND+' --help', **kw) p = subprocess.Popen(pysollib.settings.FCS_COMMAND+' --help', **kw)
@ -134,7 +136,7 @@ def init():
if os.name == 'posix': if os.name == 'posix':
os.wait() # kill zombi os.wait() # kill zombi
except: except:
#traceback.print_exc() # traceback.print_exc()
pass pass
os.environ['FREECELL_SOLVER_QUIET'] = '1' os.environ['FREECELL_SOLVER_QUIET'] = '1'
@ -142,4 +144,3 @@ def init():
if '--no-games-menu' in sys.argv: if '--no-games-menu' in sys.argv:
sys.argv.remove('--no-games-menu') sys.argv.remove('--no-games-menu')
pysollib.settings.SELECT_GAME_MENU = False pysollib.settings.SELECT_GAME_MENU = False

View file

@ -9,7 +9,7 @@ use Test::Differences qw( eq_or_diff );
use String::ShellQuote qw/ shell_quote /; use String::ShellQuote qw/ shell_quote /;
# my $cmd = shell_quote( 'flake8', '.' ); # my $cmd = shell_quote( 'flake8', '.' );
my $cmd = shell_quote( 'flake8', glob('./pysollib/[a-h]*.py') ); my $cmd = shell_quote( 'flake8', glob('./pysollib/[a-i]*.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." );