mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Compare commits
8 commits
41b4e75f15
...
7934babad2
Author | SHA1 | Date | |
---|---|---|---|
|
7934babad2 | ||
|
62005c7c42 | ||
|
c30d131181 | ||
|
18efc0e5d3 | ||
|
63c6aa5816 | ||
|
5062f0e0d9 | ||
|
0aad4261d8 | ||
|
c13b8587fc |
7 changed files with 122 additions and 118 deletions
|
@ -8,15 +8,7 @@ install:
|
||||||
- choco install strawberryperl
|
- choco install strawberryperl
|
||||||
- copy %PYTHON%\python.exe %PYTHON%\python3.exe
|
- copy %PYTHON%\python.exe %PYTHON%\python3.exe
|
||||||
- SET PATH=%PYTHON%;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
|
- SET PATH=%PYTHON%;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
|
||||||
- python3 -mpip install Pillow
|
- python3 -mpip install Pillow attrs flake8 flake8-import-order py2exe pycotap pygame pysol-cards random2 six
|
||||||
- python3 -mpip install flake8
|
|
||||||
- python3 -mpip install flake8-import-order
|
|
||||||
- python3 -mpip install py2exe
|
|
||||||
- python3 -mpip install pycotap
|
|
||||||
- python3 -mpip install pygame
|
|
||||||
- python3 -mpip install pysol-cards
|
|
||||||
- python3 -mpip install random2
|
|
||||||
- python3 -mpip install six
|
|
||||||
- perl -v
|
- perl -v
|
||||||
- copy C:\msys64\mingw64\bin\mingw32-make.exe C:\msys64\mingw64\bin\make.exe
|
- copy C:\msys64\mingw64\bin\mingw32-make.exe C:\msys64\mingw64\bin\make.exe
|
||||||
- SET PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
|
- SET PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
|
||||||
|
|
|
@ -39,7 +39,7 @@ before_install:
|
||||||
install:
|
install:
|
||||||
- sudo cpanm --notest Capture::Tiny
|
- sudo cpanm --notest Capture::Tiny
|
||||||
- sudo cpanm Code::TidyAll::Plugin::Flake8 Perl::Tidy Test::Code::TidyAll Test::Differences Test::TrailingSpace
|
- sudo cpanm Code::TidyAll::Plugin::Flake8 Perl::Tidy Test::Code::TidyAll Test::Differences Test::TrailingSpace
|
||||||
- export PY_MODS='pycotap pysol-cards random2 six'
|
- export PY_MODS='attrs pycotap pysol-cards random2 six'
|
||||||
- "`which python3` -m pip install --upgrade flake8 flake8-import-order $PY_MODS"
|
- "`which python3` -m pip install --upgrade flake8 flake8-import-order $PY_MODS"
|
||||||
- "sudo /usr/bin/python3 -m pip install --upgrade $PY_MODS || true"
|
- "sudo /usr/bin/python3 -m pip install --upgrade $PY_MODS || true"
|
||||||
- "sudo `which python2` -m pip install --upgrade $PY_MODS"
|
- "sudo `which python2` -m pip install --upgrade $PY_MODS"
|
||||||
|
|
8
Makefile
8
Makefile
|
@ -47,7 +47,7 @@ pot:
|
||||||
done
|
done
|
||||||
|
|
||||||
mo:
|
mo:
|
||||||
for loc in ru ru_RU de de_AT de_BE de_DE de_LU de_CH pl pl_PL it it_IT; do \
|
for loc in ru de pl it; do \
|
||||||
test -d locale/$${loc}/LC_MESSAGES || mkdir -p locale/$${loc}/LC_MESSAGES; \
|
test -d locale/$${loc}/LC_MESSAGES || mkdir -p locale/$${loc}/LC_MESSAGES; \
|
||||||
done
|
done
|
||||||
for lang in ru pl it; do \
|
for lang in ru pl it; do \
|
||||||
|
@ -56,12 +56,6 @@ mo:
|
||||||
for lang in ru de pl it; do \
|
for lang in ru de pl it; do \
|
||||||
msgfmt -o locale/$${lang}/LC_MESSAGES/pysol.mo po/$${lang}.po; \
|
msgfmt -o locale/$${lang}/LC_MESSAGES/pysol.mo po/$${lang}.po; \
|
||||||
done
|
done
|
||||||
cp -f locale/ru/LC_MESSAGES/pysol.mo locale/ru_RU/LC_MESSAGES/pysol.mo
|
|
||||||
for dir in de_AT de_BE de_DE de_LU de_CH; do \
|
|
||||||
cp -f locale/de/LC_MESSAGES/pysol.mo locale/$${dir}/LC_MESSAGES/pysol.mo; \
|
|
||||||
done
|
|
||||||
cp -f locale/pl/LC_MESSAGES/pysol.mo locale/pl_PL/LC_MESSAGES/pysol.mo
|
|
||||||
cp -f locale/it/LC_MESSAGES/pysol.mo locale/it_IT/LC_MESSAGES/pysol.mo
|
|
||||||
|
|
||||||
pretest:
|
pretest:
|
||||||
@rm -f tests/individually-importing/*.py # To avoid stray files
|
@rm -f tests/individually-importing/*.py # To avoid stray files
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Encoding=UTF-8
|
|
||||||
Name=PySol Fan Club Edition
|
Name=PySol Fan Club Edition
|
||||||
|
Comment=More than 1000 solitaire card games
|
||||||
Exec=pysol.py
|
Exec=pysol.py
|
||||||
|
StartupWMClass=Pysol
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
Categories=Game;CardGame;
|
Categories=Game;CardGame;
|
||||||
|
Keywords=solitaire;patience;cards;pysolfc;klondike;
|
||||||
Icon=/usr/share/icons/pysol01.png
|
Icon=/usr/share/icons/pysol01.png
|
||||||
|
|
|
@ -27,6 +27,8 @@ import time
|
||||||
import traceback
|
import traceback
|
||||||
from pickle import Pickler, Unpickler, UnpicklingError
|
from pickle import Pickler, Unpickler, UnpicklingError
|
||||||
|
|
||||||
|
import attr
|
||||||
|
|
||||||
from pysol_cards.cards import ms_rearrange
|
from pysol_cards.cards import ms_rearrange
|
||||||
|
|
||||||
from pysollib.game.dump import pysolDumpGame
|
from pysollib.game.dump import pysolDumpGame
|
||||||
|
@ -256,6 +258,65 @@ def _highlightCards__calc_item(canvas, delta, cw, ch, s, c1, c2, color):
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
||||||
|
@attr.s
|
||||||
|
class StackGroups(object):
|
||||||
|
dropstacks = attr.ib(factory=list)
|
||||||
|
hp_stacks = attr.ib(factory=list) # for getHightlightPilesStacks()
|
||||||
|
openstacks = attr.ib(factory=list)
|
||||||
|
reservestacks = attr.ib(factory=list)
|
||||||
|
talonstacks = attr.ib(factory=list)
|
||||||
|
|
||||||
|
def to_tuples(self):
|
||||||
|
"""docstring for to_tuples"""
|
||||||
|
self.openstacks = [s for s in self.openstacks
|
||||||
|
if s.cap.max_accept >= s.cap.min_accept]
|
||||||
|
self.hp_stacks = [s for s in self.dropstacks
|
||||||
|
if s.cap.max_move >= 2]
|
||||||
|
self.openstacks = tuple(self.openstacks)
|
||||||
|
self.talonstacks = tuple(self.talonstacks)
|
||||||
|
self.dropstacks = tuple(self.dropstacks)
|
||||||
|
self.reservestacks = tuple(self.reservestacks)
|
||||||
|
self.hp_stacks = tuple(self.hp_stacks)
|
||||||
|
|
||||||
|
|
||||||
|
@attr.s
|
||||||
|
class StackRegions(object):
|
||||||
|
# list of tuples(stacks, rect)
|
||||||
|
info = attr.ib(factory=list)
|
||||||
|
# list of stacks in no region
|
||||||
|
remaining = attr.ib(factory=list)
|
||||||
|
data = attr.ib(factory=list)
|
||||||
|
# init info (at the start)
|
||||||
|
init_info = attr.ib(factory=list)
|
||||||
|
|
||||||
|
def calc_info(self, xf, yf):
|
||||||
|
"""docstring for calc_info"""
|
||||||
|
info = []
|
||||||
|
for stacks, rect in self.init_info:
|
||||||
|
newrect = (int(round(rect[0]*xf)), int(round(rect[1]*yf)),
|
||||||
|
int(round(rect[2]*xf)), int(round(rect[3]*yf)))
|
||||||
|
info.append((stacks, newrect))
|
||||||
|
self.info = tuple(info)
|
||||||
|
|
||||||
|
def optimize(self, remaining):
|
||||||
|
"""docstring for optimize"""
|
||||||
|
# sort data by priority
|
||||||
|
self.data.sort()
|
||||||
|
self.data.reverse()
|
||||||
|
# copy (stacks, rect) to info
|
||||||
|
self.info = []
|
||||||
|
for d in self.data:
|
||||||
|
self.info.append((d[2], d[3]))
|
||||||
|
self.info = tuple(self.info)
|
||||||
|
# determine remaining stacks
|
||||||
|
for stacks, rect in self.info:
|
||||||
|
for stack in stacks:
|
||||||
|
while stack in remaining:
|
||||||
|
remaining.remove(stack)
|
||||||
|
self.remaining = tuple(remaining)
|
||||||
|
self.init_info = self.info
|
||||||
|
|
||||||
|
|
||||||
class Game(object):
|
class Game(object):
|
||||||
# for self.gstats.updated
|
# for self.gstats.updated
|
||||||
U_PLAY = 0
|
U_PLAY = 0
|
||||||
|
@ -305,23 +366,8 @@ class Game(object):
|
||||||
reserves=[],
|
reserves=[],
|
||||||
internals=[],
|
internals=[],
|
||||||
)
|
)
|
||||||
self.sg = Struct( # stack-groups
|
self.sg = StackGroups()
|
||||||
openstacks=[], # for getClosestStack(): only on
|
self.regions = StackRegions()
|
||||||
# these stacks the player can place a card
|
|
||||||
talonstacks=[], # for Hint
|
|
||||||
dropstacks=[], # for Hint & getAutoStacks()
|
|
||||||
reservestacks=[], # for Hint
|
|
||||||
# hint=Struct(), # extra info for class Hint
|
|
||||||
hp_stacks=[], # for getHightlightPilesStacks()
|
|
||||||
)
|
|
||||||
self.regions = Struct( # for getClosestStack()
|
|
||||||
# set by optimizeRegions():
|
|
||||||
info=[], # list of tuples(stacks, rect)
|
|
||||||
remaining=[], # list of stacks in no region
|
|
||||||
#
|
|
||||||
data=[], # raw data
|
|
||||||
init_info=[], # init info (at the start)
|
|
||||||
)
|
|
||||||
self.init_size = (0, 0)
|
self.init_size = (0, 0)
|
||||||
self.event_handled = False # if click event handled by Stack (???)
|
self.event_handled = False # if click event handled by Stack (???)
|
||||||
self.reset()
|
self.reset()
|
||||||
|
@ -340,10 +386,6 @@ class Game(object):
|
||||||
self.app.intro.progress.update(step=1)
|
self.app.intro.progress.update(step=1)
|
||||||
self.createGame()
|
self.createGame()
|
||||||
# set some defaults
|
# set some defaults
|
||||||
self.sg.openstacks = [s for s in self.sg.openstacks
|
|
||||||
if s.cap.max_accept >= s.cap.min_accept]
|
|
||||||
self.sg.hp_stacks = [s for s in self.sg.dropstacks
|
|
||||||
if s.cap.max_move >= 2]
|
|
||||||
self.createSnGroups()
|
self.createSnGroups()
|
||||||
# convert stackgroups to tuples (speed)
|
# convert stackgroups to tuples (speed)
|
||||||
self.allstacks = tuple(self.allstacks)
|
self.allstacks = tuple(self.allstacks)
|
||||||
|
@ -351,11 +393,7 @@ class Game(object):
|
||||||
self.s.rows = tuple(self.s.rows)
|
self.s.rows = tuple(self.s.rows)
|
||||||
self.s.reserves = tuple(self.s.reserves)
|
self.s.reserves = tuple(self.s.reserves)
|
||||||
self.s.internals = tuple(self.s.internals)
|
self.s.internals = tuple(self.s.internals)
|
||||||
self.sg.openstacks = tuple(self.sg.openstacks)
|
self.sg.to_tuples()
|
||||||
self.sg.talonstacks = tuple(self.sg.talonstacks)
|
|
||||||
self.sg.dropstacks = tuple(self.sg.dropstacks)
|
|
||||||
self.sg.reservestacks = tuple(self.sg.reservestacks)
|
|
||||||
self.sg.hp_stacks = tuple(self.sg.hp_stacks)
|
|
||||||
# init the stack view
|
# init the stack view
|
||||||
for stack in self.allstacks:
|
for stack in self.allstacks:
|
||||||
stack.prepareStack()
|
stack.prepareStack()
|
||||||
|
@ -365,7 +403,6 @@ class Game(object):
|
||||||
assert hasattr(self.s.talon, "max_rounds")
|
assert hasattr(self.s.talon, "max_rounds")
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
self._checkGame()
|
self._checkGame()
|
||||||
# optimize regions
|
|
||||||
self.optimizeRegions()
|
self.optimizeRegions()
|
||||||
# create cards
|
# create cards
|
||||||
if not self.cards:
|
if not self.cards:
|
||||||
|
@ -541,7 +578,6 @@ class Game(object):
|
||||||
for stack in self.allstacks:
|
for stack in self.allstacks:
|
||||||
stack.prepareStack()
|
stack.prepareStack()
|
||||||
stack.assertStack()
|
stack.assertStack()
|
||||||
# optimize regions
|
|
||||||
self.optimizeRegions()
|
self.optimizeRegions()
|
||||||
# create cards
|
# create cards
|
||||||
self.cards = self.createCards()
|
self.cards = self.createCards()
|
||||||
|
@ -905,12 +941,7 @@ class Game(object):
|
||||||
x, y = int(round(x0*xf)), int(round(y0*yf))
|
x, y = int(round(x0*xf)), int(round(y0*yf))
|
||||||
stack.resize(xf, yf)
|
stack.resize(xf, yf)
|
||||||
stack.updatePositions()
|
stack.updatePositions()
|
||||||
info = []
|
self.regions.calc_info(xf, yf)
|
||||||
for stacks, rect in self.regions.init_info:
|
|
||||||
rect = (int(round(rect[0]*xf)), int(round(rect[1]*yf)),
|
|
||||||
int(round(rect[2]*xf)), int(round(rect[3]*yf)))
|
|
||||||
info.append((stacks, rect))
|
|
||||||
self.regions.info = tuple(info)
|
|
||||||
# texts
|
# texts
|
||||||
for t in ('info', 'help', 'misc', 'score', 'base_rank'):
|
for t in ('info', 'help', 'misc', 'score', 'base_rank'):
|
||||||
init_coord = getattr(self.init_texts, t)
|
init_coord = getattr(self.init_texts, t)
|
||||||
|
@ -1719,22 +1750,7 @@ class Game(object):
|
||||||
# as getClosestStack() is called within the mouse motion handler
|
# as getClosestStack() is called within the mouse motion handler
|
||||||
# event it is worth optimizing a little bit
|
# event it is worth optimizing a little bit
|
||||||
def optimizeRegions(self):
|
def optimizeRegions(self):
|
||||||
# sort regions.data by priority
|
return self.regions.optimize(list(self.sg.openstacks))
|
||||||
self.regions.data.sort()
|
|
||||||
self.regions.data.reverse()
|
|
||||||
# copy (stacks, rect) to regions.info
|
|
||||||
self.regions.info = []
|
|
||||||
for d in self.regions.data:
|
|
||||||
self.regions.info.append((d[2], d[3]))
|
|
||||||
self.regions.info = tuple(self.regions.info)
|
|
||||||
# determine remaining stacks
|
|
||||||
remaining = list(self.sg.openstacks)
|
|
||||||
for stacks, rect in self.regions.info:
|
|
||||||
for stack in stacks:
|
|
||||||
while stack in remaining:
|
|
||||||
remaining.remove(stack)
|
|
||||||
self.regions.remaining = tuple(remaining)
|
|
||||||
self.regions.init_info = self.regions.info
|
|
||||||
|
|
||||||
def getInvisibleCoords(self):
|
def getInvisibleCoords(self):
|
||||||
# for InvisibleStack, etc
|
# for InvisibleStack, etc
|
||||||
|
@ -1861,18 +1877,20 @@ class Game(object):
|
||||||
top_msg = ''
|
top_msg = ''
|
||||||
if ret:
|
if ret:
|
||||||
if ret[0] and ret[1]:
|
if ret[0] and ret[1]:
|
||||||
top_msg = _('''
|
top_msg = _(
|
||||||
You have reached
|
'''\nYou have reached\n''' +
|
||||||
# %d in the %s of playing time
|
'# %d in the %s of playing time' +
|
||||||
and # %d in the %s of moves.''') % (ret[0], TOP_TITLE, ret[1], TOP_TITLE)
|
'\nand # %d in the %s of moves.') % \
|
||||||
|
(ret[0], TOP_TITLE, ret[1], TOP_TITLE)
|
||||||
elif ret[0]: # playing time
|
elif ret[0]: # playing time
|
||||||
top_msg = _('''
|
top_msg = _(
|
||||||
You have reached
|
'''\nYou have reached\n''' +
|
||||||
# %d in the %s of playing time.''') % (ret[0], TOP_TITLE)
|
'''# %d in the %s of playing time.''') \
|
||||||
|
% (ret[0], TOP_TITLE)
|
||||||
elif ret[1]: # moves
|
elif ret[1]: # moves
|
||||||
top_msg = _('''
|
top_msg = _(
|
||||||
You have reached
|
'''\nYou have reached\n''' +
|
||||||
# %d in the %s of moves.''') % (ret[1], TOP_TITLE)
|
'# %d in the %s of moves.') % (ret[1], TOP_TITLE)
|
||||||
return top_msg
|
return top_msg
|
||||||
elif not demo:
|
elif not demo:
|
||||||
# only update the session log
|
# only update the session log
|
||||||
|
@ -1908,16 +1926,12 @@ You have reached
|
||||||
'''Your playing time is %s\nfor %d moves.''',
|
'''Your playing time is %s\nfor %d moves.''',
|
||||||
self.moves.index)
|
self.moves.index)
|
||||||
text = text % (time, self.moves.index)
|
text = text % (time, self.moves.index)
|
||||||
d = MfxMessageDialog(self.top, title=_("Game won"),
|
d = MfxMessageDialog(
|
||||||
text=_('''
|
self.top, title=_("Game won"),
|
||||||
Congratulations, this
|
text=_('\nCongratulations, this\nwas a truly perfect game !' +
|
||||||
was a truly perfect game !
|
'\n\n%s\n%s\n') % (text, top_msg),
|
||||||
|
strings=(_("&New game"), None, _("&Cancel")),
|
||||||
%s
|
image=self.app.gimages.logos[5])
|
||||||
%s
|
|
||||||
''') % (text, top_msg),
|
|
||||||
strings=(_("&New game"), None, _("&Cancel")),
|
|
||||||
image=self.app.gimages.logos[5])
|
|
||||||
elif status == 1:
|
elif status == 1:
|
||||||
top_msg = self.updateStats()
|
top_msg = self.updateStats()
|
||||||
time = self.getTime()
|
time = self.getTime()
|
||||||
|
@ -1928,15 +1942,14 @@ was a truly perfect game !
|
||||||
'''Your playing time is %s\nfor %d moves.''',
|
'''Your playing time is %s\nfor %d moves.''',
|
||||||
self.moves.index)
|
self.moves.index)
|
||||||
text = text % (time, self.moves.index)
|
text = text % (time, self.moves.index)
|
||||||
d = MfxMessageDialog(self.top, title=_("Game won"),
|
d = MfxMessageDialog(
|
||||||
text=_('''
|
self.top, title=_("Game won"),
|
||||||
Congratulations, you did it !
|
text=(
|
||||||
|
_('\nCongratulations, you did it !\n\n%s\n%s\n') %
|
||||||
%s
|
(text, top_msg)
|
||||||
%s
|
),
|
||||||
''') % (text, top_msg),
|
strings=(_("&New game"), None, _("&Cancel")),
|
||||||
strings=(_("&New game"), None, _("&Cancel")),
|
image=self.app.gimages.logos[4])
|
||||||
image=self.app.gimages.logos[4])
|
|
||||||
elif self.gstats.updated < 0:
|
elif self.gstats.updated < 0:
|
||||||
self.finished = True
|
self.finished = True
|
||||||
self.playSample("gamefinished", priority=1000)
|
self.playSample("gamefinished", priority=1000)
|
||||||
|
@ -3007,11 +3020,10 @@ Congratulations, you did it !
|
||||||
self.setCursor(cursor=self.app.top_cursor)
|
self.setCursor(cursor=self.app.top_cursor)
|
||||||
MfxMessageDialog(
|
MfxMessageDialog(
|
||||||
self.top, title=_("Load game error"), bitmap="error",
|
self.top, title=_("Load game error"), bitmap="error",
|
||||||
text=_("""\
|
text=_(
|
||||||
Error while loading game.
|
"Error while loading game.\n\n" +
|
||||||
|
"Probably the game file is damaged,\n" +
|
||||||
Probably the game file is damaged,
|
"but this could also be a bug you might want to report."))
|
||||||
but this could also be a bug you might want to report."""))
|
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
except UnpicklingError as ex:
|
except UnpicklingError as ex:
|
||||||
self.updateMenus()
|
self.updateMenus()
|
||||||
|
@ -3021,11 +3033,11 @@ but this could also be a bug you might want to report."""))
|
||||||
except Exception:
|
except Exception:
|
||||||
self.updateMenus()
|
self.updateMenus()
|
||||||
self.setCursor(cursor=self.app.top_cursor)
|
self.setCursor(cursor=self.app.top_cursor)
|
||||||
MfxMessageDialog(self.top, title=_("Load game error"),
|
MfxMessageDialog(
|
||||||
bitmap="error", text=_("""\
|
self.top, title=_("Load game error"),
|
||||||
Internal error while loading game.
|
bitmap="error", text=_(
|
||||||
|
"""Internal error while loading game.\n\n""" +
|
||||||
Please report this bug."""))
|
"Please report this bug."))
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
else:
|
else:
|
||||||
if self.pause:
|
if self.pause:
|
||||||
|
@ -3088,9 +3100,11 @@ Please report this bug."""))
|
||||||
version = pload(str)
|
version = pload(str)
|
||||||
# validate(isinstance(version, str) and len(version) <= 20, err_txt)
|
# validate(isinstance(version, str) and len(version) <= 20, err_txt)
|
||||||
version_tuple = pload(tuple)
|
version_tuple = pload(tuple)
|
||||||
validate(version_tuple >= (1, 0), _('''\
|
validate(
|
||||||
Cannot load games saved with
|
version_tuple >= (1, 0),
|
||||||
%s version %s''') % (PACKAGE, version))
|
_('''Cannot load games saved with\n%s version %s''') % (
|
||||||
|
PACKAGE,
|
||||||
|
version))
|
||||||
game_version = 1
|
game_version = 1
|
||||||
bookmark = pload(int)
|
bookmark = pload(int)
|
||||||
validate(0 <= bookmark <= 2, err_txt)
|
validate(0 <= bookmark <= 2, err_txt)
|
||||||
|
@ -3105,10 +3119,11 @@ Cannot load games saved with
|
||||||
if not game.canLoadGame(version_tuple, game_version):
|
if not game.canLoadGame(version_tuple, game_version):
|
||||||
destruct(game)
|
destruct(game)
|
||||||
game = None
|
game = None
|
||||||
validate(game is not None, _('''\
|
validate(
|
||||||
Cannot load this game from version %s
|
game is not None,
|
||||||
as the game rules have changed
|
_('Cannot load this game from version %s\n' +
|
||||||
in the current implementation.''') % version)
|
'as the game rules have changed\n' +
|
||||||
|
'in the current implementation.') % version)
|
||||||
game.version = version
|
game.version = version
|
||||||
game.version_tuple = version_tuple
|
game.version_tuple = version_tuple
|
||||||
#
|
#
|
||||||
|
|
|
@ -14,7 +14,8 @@ for d, _, files in os.walk("pysollib"):
|
||||||
for f in files:
|
for f in files:
|
||||||
if re.search("\\.py$", f):
|
if re.search("\\.py$", f):
|
||||||
module_names.append(
|
module_names.append(
|
||||||
(d + "/" + re.sub("\\.py$", "", f)).replace("/", "."))
|
(d + "/" + re.sub("\\.py$", "", f))
|
||||||
|
.replace("/", ".").replace(os.sep, "."))
|
||||||
|
|
||||||
module_names.sort()
|
module_names.sort()
|
||||||
for module_name in module_names:
|
for module_name in module_names:
|
||||||
|
|
6
setup.py
6
setup.py
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
|
from glob import glob
|
||||||
|
|
||||||
from pysollib.settings import PACKAGE_URL
|
from pysollib.settings import PACKAGE_URL
|
||||||
from pysollib.settings import VERSION
|
from pysollib.settings import VERSION
|
||||||
|
@ -45,9 +46,8 @@ if os.name == 'posix':
|
||||||
data_files.append(('share/icons',
|
data_files.append(('share/icons',
|
||||||
['data/images/misc/pysol01.png',
|
['data/images/misc/pysol01.png',
|
||||||
'data/images/misc/pysol02.png', ]))
|
'data/images/misc/pysol02.png', ]))
|
||||||
for l in ('ru', 'ru_RU'):
|
for mofile in glob('locale/*/*/*.mo'):
|
||||||
data_files.append(('share/locale/%s/LC_MESSAGES' % l,
|
data_files.append(('share/' + os.path.dirname(mofile), [mofile]))
|
||||||
['locale/%s/LC_MESSAGES/pysol.mo' % l]))
|
|
||||||
data_files.append((data_dir, ['data/pysolfc.glade']))
|
data_files.append((data_dir, ['data/pysolfc.glade']))
|
||||||
data_files.append(('share/applications', ['data/pysol.desktop']))
|
data_files.append(('share/applications', ['data/pysol.desktop']))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue