Commit 1836978c authored by Hugo Lefeuvre's avatar Hugo Lefeuvre

Refresh patches for new release.

parent 3380de25
......@@ -8,6 +8,8 @@ pysolfc (2.1.2-1) unstable; urgency=medium
- Update debhelper dependency to match new compat level.
* debian/copyright:
- Update copyright years.
* Remove pillow and montana patches (both merged upstream).
* Refresh patches for new upstream release.
-- Hugo Lefeuvre <hle@debian.org> Sun, 29 Jul 2018 15:38:04 +0800
......
Description: Add DoubleBlueMoon and DoubleRedMoon games, plus some minor fixes.
Origin: http://pysolfc.svn.sourceforge.net/viewvc/pysolfc/PySolFC/trunk/pysollib/games/montana.py?r1=243&r2=270&view=patch
Index: pysolfc-2.0/pysollib/games/montana.py
===================================================================
--- pysolfc-2.0.orig/pysollib/games/montana.py
+++ pysolfc-2.0/pysollib/games/montana.py
@@ -81,14 +81,15 @@
def dealCards(self, sound=False):
# move cards to the Talon, shuffle and redeal
game = self.game
+ decks = game.gameinfo.decks
RLEN, RSTEP, RBASE = game.RLEN, game.RSTEP, game.RBASE
num_cards = 0
assert len(self.cards) == 0
rows = game.s.rows
# move out-of-sequence cards from the Tableau to the Talon
stacks = []
- gaps = [None] * 4
- for g in range(4):
+ gaps = [None] * 4 * decks
+ for g in range(4*decks):
i = g * RSTEP
r = rows[i]
if r.cards and r.cards[-1].rank == RBASE:
@@ -292,11 +293,12 @@
return self._shuffleHookMoveToTop(cards, lambda c: (c.rank == 0, c.suit))
def startGame(self):
+ decks = self.gameinfo.decks
frames = 0
r = self.s.rows
- self.s.talon.dealRow(rows=(r[0],r[14],r[28],r[42]), frames=frames)
- for i in range(4):
- if i == 3:
+ self.s.talon.dealRow(rows=(r[::14]), frames=frames)
+ for i in range(4*decks):
+ if i == 4*decks-1:
self.startDealSample()
frames = 4
n = i * 14 + 2
@@ -587,6 +589,20 @@
continue
self.s.talon.dealRow(rows=(self.s.rows[i],), frames=frames)
+class DoubleBlueMoon(DoubleMontana, BlueMoon):
+ Talon_Class = StackWrapper(Montana_Talon, max_rounds=3)
+ RLEN, RSTEP, RBASE = 112, 14, 0
+ def createGame(self):
+ BlueMoon.createGame(self, round_text=True)
+ startGame = BlueMoon.startGame
+
+class DoubleRedMoon(DoubleMontana, RedMoon):
+ Talon_Class = StackWrapper(Montana_Talon, max_rounds=3)
+ RLEN, RROWS = 112, 8
+ _shuffleHook = RedMoon._shuffleHook
+ def createGame(self):
+ RedMoon.createGame(self, round_text=True)
+ startGame = RedMoon.startGame
# register the game
@@ -620,5 +636,9 @@
))
registerGame(GameInfo(759, DoubleMontana, "Double Montana",
GI.GT_MONTANA | GI.GT_OPEN, 2, 0, GI.SL_MOSTLY_SKILL))
+registerGame(GameInfo(770, DoubleBlueMoon, "Double Blue Moon",
+ GI.GT_MONTANA | GI.GT_OPEN, 2, 2, GI.SL_MOSTLY_SKILL))
+registerGame(GameInfo(771, DoubleRedMoon, "Double Red Moon",
+ GI.GT_MONTANA | GI.GT_OPEN, 2, 2, GI.SL_MOSTLY_SKILL))
Description: Fix PIL imports for pillow compatibility --
see 5117D0B7.801@debian.org (LP: 1160571).
There's a version of this patch (without the checks for ImportError) in
upstream's patch tracker at https://sourceforge.net/p/pysolfc/patches/10/
Author: Bernhard Reiter <ockham@raz.or.at>
Forwarded: no
--- a/pysollib/mfxutil.py
+++ b/pysollib/mfxutil.py
@@ -41,18 +41,30 @@
Image = ImageTk = ImageOps = None
if TOOLKIT == 'tk':
try: # PIL
- import Image
- import ImageTk
- import ImageOps
+ try:
+ from PIL import Image
+ from PIL import ImageTk
+ from PIL import ImageOps
+ except ImportError:
+ import Image
+ import ImageTk
+ import ImageOps
except ImportError:
Image = None
else:
# for py2exe
- import GifImagePlugin
- import PngImagePlugin
- import JpegImagePlugin
- import BmpImagePlugin
- import PpmImagePlugin
+ try:
+ from PIL import GifImagePlugin
+ from PIL import PngImagePlugin
+ from PIL import JpegImagePlugin
+ from PIL import BmpImagePlugin
+ from PIL import PpmImagePlugin
+ except ImportError:
+ import GifImagePlugin
+ import PngImagePlugin
+ import JpegImagePlugin
+ import BmpImagePlugin
+ import PpmImagePlugin
Image._initialized = 2
--- a/scripts/cardset_viewer.py
+++ b/scripts/cardset_viewer.py
@@ -7,7 +7,10 @@
from math import sqrt, sin, cos, pi
from Tkinter import *
try:
- import Image, ImageTk
+ try:
+ from PIL import Image, ImageTk
+ except ImportError:
+ import Image, ImageTk
except ImportError:
Image = None
......@@ -3,14 +3,12 @@ Description: Remove checks for individual cardsets' COPYRIGHT files
Author: Bernhard Reiter <ockham@raz.or.at>
Forwarded: not-needed
Index: pysolfc/pysollib/app.py
===================================================================
--- pysolfc.orig/pysollib/app.py 2011-12-13 23:11:09.611745235 +0100
+++ pysolfc/pysollib/app.py 2011-12-13 23:19:33.306242924 +0100
@@ -1394,11 +1394,10 @@
if not name.startswith('cardset-'): continue
--- a/pysollib/app.py 2018-07-31 11:44:58.127291946 +0800
+++ b/pysollib/app.py 2018-07-31 11:46:17.375162990 +0800
@@ -1439,11 +1439,10 @@
d = os.path.join(dir, name)
if not os.path.isdir(d): continue
if not os.path.isdir(d):
continue
- f1 = os.path.join(d, "config.txt")
- f2 = os.path.join(d, "COPYRIGHT")
- if os.path.isfile(f1) and os.path.isfile(f2):
......@@ -20,22 +18,20 @@ Index: pysolfc/pysollib/app.py
- cs = self._readCardsetConfig(d, f1)
+ cs = self._readCardsetConfig(d, f)
if cs:
##from pprint import pprint
##print cs.name
@@ -1412,7 +1411,7 @@
#print '+', cs.name
# from pprint import pprint
# print cs.name
@@ -1458,7 +1457,7 @@
# print '+', cs.name
else:
print_err('fail _readCardsetConfig: %s %s'
- % (d, f1))
+ % (d, f))
pass
except Exception, err:
##traceback.print_exc()
Index: pysolfc/pysollib/tile/selectcardset.py
===================================================================
--- pysolfc.orig/pysollib/tile/selectcardset.py 2011-12-13 23:11:09.619745274 +0100
+++ pysolfc/pysollib/tile/selectcardset.py 2011-12-13 23:19:33.306242924 +0100
@@ -357,15 +357,12 @@
except Exception:
# traceback.print_exc()
--- a/pysollib/tile/selectcardset.py 2018-07-31 11:44:58.127291946 +0800
+++ b/pysollib/tile/selectcardset.py 2018-07-31 12:08:12.030780247 +0800
@@ -525,15 +525,12 @@
frame.columnconfigure(0, weight=1)
frame.rowconfigure(1, weight=1)
#
......@@ -43,7 +39,7 @@ Index: pysolfc/pysollib/tile/selectcardset.py
- f = os.path.join(cardset.dir, "COPYRIGHT")
- try:
- text = open(f).read()
- except:
- except Exception:
- pass
- if text:
- text_w.config(state="normal")
......@@ -57,11 +53,9 @@ Index: pysolfc/pysollib/tile/selectcardset.py
text_w.config(state="disabled")
#
focus = self.createButtons(bottom_frame, kw)
Index: pysolfc/pysollib/tk/selectcardset.py
===================================================================
--- pysolfc.orig/pysollib/tk/selectcardset.py 2011-12-13 23:19:45.874305245 +0100
+++ pysolfc/pysollib/tk/selectcardset.py 2011-12-13 23:23:03.583285630 +0100
@@ -357,15 +357,12 @@
--- a/pysollib/tk/selectcardset.py 2018-07-31 11:44:58.127291946 +0800
+++ b/pysollib/tk/selectcardset.py 2018-07-31 12:08:56.859500724 +0800
@@ -488,15 +488,12 @@
frame.columnconfigure(0, weight=1)
frame.rowconfigure(1, weight=1)
#
......@@ -69,7 +63,7 @@ Index: pysolfc/pysollib/tk/selectcardset.py
- f = os.path.join(cardset.dir, "COPYRIGHT")
- try:
- text = open(f).read()
- except:
- except Exception:
- pass
- if text:
- text_w.config(state="normal")
......
......@@ -4,5 +4,3 @@ desktop
manpage
directories
all_games-paths
montana
pillow
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment