From a61a0a60d51dd8b61cda908663cfe8894899e5a7 Mon Sep 17 00:00:00 2001 From: skomoroh Date: Sat, 4 Aug 2007 21:17:36 +0000 Subject: [PATCH] * bugfixes git-svn-id: file:///home/shlomif/Backup/svn-dumps/PySolFC/svnsync-repos/pysolfc/PySolFC/trunk@190 efabe8c0-fbe8-4139-b769-b5e6d273206e --- po/ru_pysol.po | 4 ++-- pysollib/games/grandfathersclock.py | 7 ++++++- pysollib/games/gypsy.py | 1 + pysollib/games/klondike.py | 2 +- pysollib/games/pyramid.py | 2 +- pysollib/tile/tkstats.py | 17 +++++++++++++---- 6 files changed, 24 insertions(+), 9 deletions(-) diff --git a/po/ru_pysol.po b/po/ru_pysol.po index d3d53444..8730b944 100644 --- a/po/ru_pysol.po +++ b/po/ru_pysol.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: Fri Jul 20 23:42:39 2007\n" -"PO-Revision-Date: 2007-07-20 23:52+0400\n" +"PO-Revision-Date: 2007-08-03 03:12+0400\n" "Last-Translator: Skomoroh \n" "Language-Team: Russian \n" "MIME-Version: 1.0\n" @@ -1916,7 +1916,7 @@ msgstr "Базовая ячейка. Складывать в соответст #: pysollib/stack.py:2146 msgid "Foundation. Build down regardless of suit." -msgstr "Базовая ячейка. Складывать не считаясь с мастью." +msgstr "Базовая ячейка. Складывать по убыванию не считаясь с мастью." #: pysollib/stack.py:2167 msgid "Foundation. Build up by alternate color." diff --git a/pysollib/games/grandfathersclock.py b/pysollib/games/grandfathersclock.py index 340c5877..8daba1d4 100644 --- a/pysollib/games/grandfathersclock.py +++ b/pysollib/games/grandfathersclock.py @@ -368,11 +368,16 @@ class Hemispheres(Game): class BigBen_Talon(DealRowTalonStack): def dealCards(self, sound=False): + if not self.cards: + return 0 rows = [s for s in self.game.s.rows if len(s.cards) < 3] if not rows: + # deal to the waste if sound and not self.game.demo: self.game.playSample("dealwaste") - return self.dealRow(rows=[self.game.s.waste], sound=False) + self.game.flipAndMoveMove(self, self.game.s.waste) + return 1 + # deal to the rows if sound and self.game.app.opt.animations: self.game.startDealSample() ncards = 0 diff --git a/pysollib/games/gypsy.py b/pysollib/games/gypsy.py index d2ab1f64..28aeca89 100644 --- a/pysollib/games/gypsy.py +++ b/pysollib/games/gypsy.py @@ -929,6 +929,7 @@ class Thirty_RowStack(BasicRowStack): class Thirty(Game): + Hint_Class = Spider_Hint def createGame(self): diff --git a/pysollib/games/klondike.py b/pysollib/games/klondike.py index 9b41ba97..30752a05 100644 --- a/pysollib/games/klondike.py +++ b/pysollib/games/klondike.py @@ -1220,7 +1220,7 @@ class LuckyPiles(LuckyThirteen): RowStack_Class = StackWrapper(UD_SS_RowStack, base_rank=KING) def createGame(self): - LuckyThirteen.createGame(self, xoffset=1, playcards=5) + LuckyThirteen.createGame(self, xoffset=1, playcards=7) shallHighlightMatch = Game._shallHighlightMatch_SS diff --git a/pysollib/games/pyramid.py b/pysollib/games/pyramid.py index d28f5f1f..9f194e25 100644 --- a/pysollib/games/pyramid.py +++ b/pysollib/games/pyramid.py @@ -74,7 +74,7 @@ class Pyramid_StackMethods: c = self.cards[-1] if c.face_up and c.rank == KING and not self.basicIsBlocked(): self.game.playSample("autodrop", priority=20) - self.playMoveMove(1, self.game.s.foundations[0], sound=sound) + self.playMoveMove(1, self.game.s.foundations[0], sound=False) return 1 return 0 diff --git a/pysollib/tile/tkstats.py b/pysollib/tile/tkstats.py index be06efd8..bbcc499b 100644 --- a/pysollib/tile/tkstats.py +++ b/pysollib/tile/tkstats.py @@ -357,19 +357,28 @@ class TreeFormatter(PysolStatsFormatter): self.tree.column(column, width=16) i += 1 - def resizeHeader(self, player, header): + def resizeHeader(self, player, header, tree_width=0): if self._tabs is not None: return self._calc_tabs(header) - i = 0 - for column in ('#0',) + self.parent_window.COLUMNS: + # set first column width + if tree_width != 0: + tab = tree_width - sum(self._tabs[1:]) + tab = min(tree_width, self._tabs[0]) + else: + tab = self._tabs[0] + self.tree.column('#0', width=tab) + # other column + i = 1 + for column in self.parent_window.COLUMNS: tab = self._tabs[i] self.tree.column(column, width=tab) i += 1 def writeStats(self, player, sort_by='name'): header = self.getStatHeader() - self.resizeHeader(player, header) + tree_width = self.tree.winfo_width() + self.resizeHeader(player, header, tree_width) for result in self.getStatResults(player, sort_by): # result == [name, won+lost, won, lost, time, moves, perc, id]