1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

* added exception block for app.loadOptions

* updated dump/undump game
* updated russian translation
* bugfixes


git-svn-id: file:///home/shlomif/Backup/svn-dumps/PySolFC/svnsync-repos/pysolfc/PySolFC/trunk@140 efabe8c0-fbe8-4139-b769-b5e6d273206e
This commit is contained in:
skomoroh 2007-02-21 23:31:55 +00:00
parent 4b70ba795c
commit 03037a4e80
16 changed files with 245 additions and 244 deletions

View file

@ -62,6 +62,7 @@ graft data/cardset-oxymoron
graft data/cardset-standard graft data/cardset-standard
graft data/cardset-tuxedo graft data/cardset-tuxedo
graft data/cardset-vienna-2k graft data/cardset-vienna-2k
graft data/cardset-dondorf
## ##
## exclude dirs ## exclude dirs
## ##

View file

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PySol 0.0.1\n" "Project-Id-Version: PySol 0.0.1\n"
"POT-Creation-Date: Thu Feb 15 18:35:01 2007\n" "POT-Creation-Date: Wed Feb 21 17:56:30 2007\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View file

@ -14,7 +14,7 @@ msgid ""
msgstr "" msgstr ""
"#-#-#-#-# pysol-1.pot (PACKAGE VERSION) #-#-#-#-#\n" "#-#-#-#-# pysol-1.pot (PACKAGE VERSION) #-#-#-#-#\n"
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: Thu Feb 15 18:36:07 2007\n" "POT-Creation-Date: Wed Feb 21 17:57:33 2007\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -24,7 +24,7 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
"#-#-#-#-# pysol-2.pot (PACKAGE VERSION) #-#-#-#-#\n" "#-#-#-#-# pysol-2.pot (PACKAGE VERSION) #-#-#-#-#\n"
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2007-02-15 18:36+0300\n" "POT-Creation-Date: 2007-02-21 17:57+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -71,7 +71,7 @@ msgid "&Next number"
msgstr "" msgstr ""
#: pysollib/actions.py:315 pysollib/app.py:891 pysollib/app.py:1178 #: pysollib/actions.py:315 pysollib/app.py:891 pysollib/app.py:1178
#: pysollib/app.py:1190 pysollib/game.py:1010 pysollib/game.py:2245 #: pysollib/app.py:1190 pysollib/game.py:1012 pysollib/game.py:2247
#: pysollib/tile/colorsdialog.py:112 pysollib/tile/edittextdialog.py:83 #: pysollib/tile/colorsdialog.py:112 pysollib/tile/edittextdialog.py:83
#: pysollib/tile/fontsdialog.py:144 pysollib/tile/fontsdialog.py:204 #: pysollib/tile/fontsdialog.py:144 pysollib/tile/fontsdialog.py:204
#: pysollib/tile/gameinfodialog.py:155 pysollib/tile/menubar.py:1344 #: pysollib/tile/gameinfodialog.py:155 pysollib/tile/menubar.py:1344
@ -100,8 +100,8 @@ msgid "&OK"
msgstr "" msgstr ""
#: pysollib/actions.py:315 pysollib/app.py:892 pysollib/app.py:1190 #: pysollib/actions.py:315 pysollib/app.py:892 pysollib/app.py:1190
#: pysollib/game.py:1010 pysollib/game.py:1674 pysollib/game.py:1690 #: pysollib/game.py:1012 pysollib/game.py:1676 pysollib/game.py:1692
#: pysollib/game.py:1697 pysollib/game.py:1703 #: pysollib/game.py:1699 pysollib/game.py:1705
#: pysollib/tile/colorsdialog.py:112 pysollib/tile/edittextdialog.py:83 #: pysollib/tile/colorsdialog.py:112 pysollib/tile/edittextdialog.py:83
#: pysollib/tile/fontsdialog.py:144 pysollib/tile/fontsdialog.py:204 #: pysollib/tile/fontsdialog.py:144 pysollib/tile/fontsdialog.py:204
#: pysollib/tile/playeroptionsdialog.py:111 pysollib/tile/selectcardset.py:237 #: pysollib/tile/playeroptionsdialog.py:111 pysollib/tile/selectcardset.py:237
@ -270,8 +270,8 @@ msgstr ""
msgid "Unknown" msgid "Unknown"
msgstr "" msgstr ""
#: pysollib/app.py:893 pysollib/game.py:1674 pysollib/game.py:1690 #: pysollib/app.py:893 pysollib/game.py:1676 pysollib/game.py:1692
#: pysollib/game.py:1697 pysollib/game.py:1703 pysollib/tile/menubar.py:358 #: pysollib/game.py:1699 pysollib/game.py:1705 pysollib/tile/menubar.py:358
#: pysollib/tk/menubar.py:355 #: pysollib/tk/menubar.py:355
msgid "&New game" msgid "&New game"
msgstr "" msgstr ""
@ -305,41 +305,41 @@ msgstr ""
msgid "Please select a %s type %s" msgid "Please select a %s type %s"
msgstr "" msgstr ""
#: pysollib/game.py:929 pysollib/game.py:935 #: pysollib/game.py:931 pysollib/game.py:937
msgid "Player\n" msgid "Player\n"
msgstr "" msgstr ""
#: pysollib/game.py:1006 #: pysollib/game.py:1008
msgid "Discard current game ?" msgid "Discard current game ?"
msgstr "" msgstr ""
#: pysollib/game.py:1627 #: pysollib/game.py:1629
msgid "" msgid ""
"\n" "\n"
"You have reached\n" "You have reached\n"
"#%d in the %s of playing time" "#%d in the %s of playing time"
msgstr "" msgstr ""
#: pysollib/game.py:1632 #: pysollib/game.py:1634
msgid "" msgid ""
"\n" "\n"
"and #%d in the %s of moves" "and #%d in the %s of moves"
msgstr "" msgstr ""
#: pysollib/game.py:1635 #: pysollib/game.py:1637
msgid "" msgid ""
"\n" "\n"
"You have reached\n" "You have reached\n"
"#%d in the %s of moves" "#%d in the %s of moves"
msgstr "" msgstr ""
#: pysollib/game.py:1665 pysollib/game.py:1682 #: pysollib/game.py:1667 pysollib/game.py:1684
#: pysollib/tile/soundoptionsdialog.py:102 #: pysollib/tile/soundoptionsdialog.py:102
#: pysollib/tk/soundoptionsdialog.py:100 #: pysollib/tk/soundoptionsdialog.py:100
msgid "Game won" msgid "Game won"
msgstr "" msgstr ""
#: pysollib/game.py:1666 #: pysollib/game.py:1668
msgid "" msgid ""
"\n" "\n"
"Congratulations, this\n" "Congratulations, this\n"
@ -350,7 +350,7 @@ msgid ""
"%s\n" "%s\n"
msgstr "" msgstr ""
#: pysollib/game.py:1683 #: pysollib/game.py:1685
msgid "" msgid ""
"\n" "\n"
"Congratulations, you did it !\n" "Congratulations, you did it !\n"
@ -360,101 +360,101 @@ msgid ""
"%s\n" "%s\n"
msgstr "" msgstr ""
#: pysollib/game.py:1695 pysollib/game.py:1701 #: pysollib/game.py:1697 pysollib/game.py:1703
#: pysollib/tile/soundoptionsdialog.py:100 #: pysollib/tile/soundoptionsdialog.py:100
#: pysollib/tk/soundoptionsdialog.py:98 #: pysollib/tk/soundoptionsdialog.py:98
msgid "Game finished" msgid "Game finished"
msgstr "" msgstr ""
#: pysollib/game.py:1696 pysollib/game.py:2246 #: pysollib/game.py:1698 pysollib/game.py:2248
msgid "" msgid ""
"\n" "\n"
"Game finished\n" "Game finished\n"
msgstr "" msgstr ""
#: pysollib/game.py:1702 #: pysollib/game.py:1704
msgid "" msgid ""
"\n" "\n"
"Game finished, but not without my help...\n" "Game finished, but not without my help...\n"
msgstr "" msgstr ""
#: pysollib/game.py:1703 #: pysollib/game.py:1705
msgid "&Restart" msgid "&Restart"
msgstr "" msgstr ""
#: pysollib/game.py:2135 #: pysollib/game.py:2137
msgid "Score %6d" msgid "Score %6d"
msgstr "" msgstr ""
#: pysollib/game.py:2237 #: pysollib/game.py:2239
msgid "&Cool" msgid "&Cool"
msgstr "" msgstr ""
#: pysollib/game.py:2237 #: pysollib/game.py:2239
msgid "&Great" msgid "&Great"
msgstr "" msgstr ""
#: pysollib/game.py:2237 #: pysollib/game.py:2239
msgid "&Wow" msgid "&Wow"
msgstr "" msgstr ""
#: pysollib/game.py:2237 #: pysollib/game.py:2239
msgid "&Yeah" msgid "&Yeah"
msgstr "" msgstr ""
#: pysollib/game.py:2238 pysollib/game.py:2249 pysollib/game.py:2261 #: pysollib/game.py:2240 pysollib/game.py:2251 pysollib/game.py:2263
msgid " Autopilot" msgid " Autopilot"
msgstr "" msgstr ""
#: pysollib/game.py:2239 #: pysollib/game.py:2241
msgid "" msgid ""
"\n" "\n"
"Game solved in %d moves.\n" "Game solved in %d moves.\n"
msgstr "" msgstr ""
#: pysollib/game.py:2260 #: pysollib/game.py:2262
msgid "&Hmm" msgid "&Hmm"
msgstr "" msgstr ""
#: pysollib/game.py:2260 #: pysollib/game.py:2262
msgid "&Oh well" msgid "&Oh well"
msgstr "" msgstr ""
#: pysollib/game.py:2260 #: pysollib/game.py:2262
msgid "&That's life" msgid "&That's life"
msgstr "" msgstr ""
#: pysollib/game.py:2262 #: pysollib/game.py:2264
msgid "" msgid ""
"\n" "\n"
"This won't come out...\n" "This won't come out...\n"
msgstr "" msgstr ""
#: pysollib/game.py:2702 #: pysollib/game.py:2704
msgid "Set bookmark" msgid "Set bookmark"
msgstr "" msgstr ""
#: pysollib/game.py:2703 #: pysollib/game.py:2705
msgid "Replace existing bookmark %d ?" msgid "Replace existing bookmark %d ?"
msgstr "" msgstr ""
#: pysollib/game.py:2725 #: pysollib/game.py:2727
msgid "Goto bookmark" msgid "Goto bookmark"
msgstr "" msgstr ""
#: pysollib/game.py:2726 #: pysollib/game.py:2728
msgid "Goto bookmark %d ?" msgid "Goto bookmark %d ?"
msgstr "" msgstr ""
#: pysollib/game.py:2757 #: pysollib/game.py:2759
msgid "Open game" msgid "Open game"
msgstr "" msgstr ""
#: pysollib/game.py:2768 pysollib/game.py:2777 pysollib/game.py:2782 #: pysollib/game.py:2770 pysollib/game.py:2780 pysollib/game.py:2785
msgid "Load game error" msgid "Load game error"
msgstr "" msgstr ""
#: pysollib/game.py:2769 #: pysollib/game.py:2771
msgid "" msgid ""
"Error while loading game.\n" "Error while loading game.\n"
"\n" "\n"
@ -462,25 +462,42 @@ msgid ""
"but this could also be a bug you might want to report." "but this could also be a bug you might want to report."
msgstr "" msgstr ""
#: pysollib/game.py:2778 #: pysollib/game.py:2781
msgid "Error while loading game" msgid "Error while loading game"
msgstr "" msgstr ""
#: pysollib/game.py:2783 #: pysollib/game.py:2786
msgid "" msgid ""
"Internal error while loading game.\n" "Internal error while loading game.\n"
"\n" "\n"
"Please report this bug." "Please report this bug."
msgstr "" msgstr ""
#: pysollib/game.py:2808 #: pysollib/game.py:2815
msgid "Save game error" msgid "Save game error"
msgstr "" msgstr ""
#: pysollib/game.py:2809 #: pysollib/game.py:2816
msgid "Error while saving game" msgid "Error while saving game"
msgstr "" msgstr ""
#: pysollib/game.py:2841
msgid "Invalid or damaged %s save file"
msgstr ""
#: pysollib/game.py:2855
msgid ""
"Cannot load games saved with\n"
"%s version %s"
msgstr ""
#: pysollib/game.py:2872
msgid ""
"Cannot load this game from version %s\n"
"as the game rules have changed\n"
"in the current implementation."
msgstr ""
#: pysollib/gamedb.py:121 #: pysollib/gamedb.py:121
msgid "Baker's Dozen" msgid "Baker's Dozen"
msgstr "" msgstr ""
@ -723,12 +740,12 @@ msgid ""
msgstr "" msgstr ""
#: pysollib/games/canfield.py:528 pysollib/games/special/tarock.py:224 #: pysollib/games/canfield.py:528 pysollib/games/special/tarock.py:224
#: pysollib/stack.py:1482 pysollib/util.py:86 #: pysollib/stack.py:1482 pysollib/util.py:85
msgid "King" msgid "King"
msgstr "" msgstr ""
#: pysollib/games/canfield.py:531 pysollib/games/special/tarock.py:224 #: pysollib/games/canfield.py:531 pysollib/games/special/tarock.py:224
#: pysollib/stack.py:1481 pysollib/util.py:86 #: pysollib/stack.py:1481 pysollib/util.py:85
msgid "Queen" msgid "Queen"
msgstr "" msgstr ""
@ -744,6 +761,10 @@ msgstr ""
msgid "X" msgid "X"
msgstr "" msgstr ""
#: pysollib/games/fan.py:470
msgid "Base card - Ace or King."
msgstr ""
#: pysollib/games/golf.py:114 pysollib/games/golf.py:302 #: pysollib/games/golf.py:114 pysollib/games/golf.py:302
#: pysollib/stack.py:2145 #: pysollib/stack.py:2145
msgid "Tableau. No building." msgid "Tableau. No building."
@ -754,15 +775,15 @@ msgstr ""
msgid "Foundation. Build up regardless of suit." msgid "Foundation. Build up regardless of suit."
msgstr "" msgstr ""
#: pysollib/games/klondike.py:112 #: pysollib/games/klondike.py:113
msgid "Balance $%d" msgid "Balance $%d"
msgstr "" msgstr ""
#: pysollib/games/klondike.py:169 pysollib/stack.py:2186 #: pysollib/games/klondike.py:170 pysollib/stack.py:2186
msgid "Tableau. Build down by color." msgid "Tableau. Build down by color."
msgstr "" msgstr ""
#: pysollib/games/klondike.py:438 #: pysollib/games/klondike.py:444
msgid "Reserve. Only Kings are acceptable." msgid "Reserve. Only Kings are acceptable."
msgstr "" msgstr ""
@ -869,7 +890,7 @@ msgstr ""
#: pysollib/games/special/tarock.py:223 #: pysollib/games/special/tarock.py:223
#: pysollib/games/ultra/dashavatara.py:351 #: pysollib/games/ultra/dashavatara.py:351
#: pysollib/games/ultra/hexadeck.py:273 pysollib/games/ultra/mughal.py:254 #: pysollib/games/ultra/hexadeck.py:273 pysollib/games/ultra/mughal.py:254
#: pysollib/stack.py:1483 pysollib/util.py:85 #: pysollib/stack.py:1483 pysollib/util.py:84
msgid "Ace" msgid "Ace"
msgstr "" msgstr ""
@ -1256,7 +1277,7 @@ msgstr ""
msgid " Help" msgid " Help"
msgstr "" msgstr ""
#: pysollib/main.py:64 pysollib/main.py:249 #: pysollib/main.py:64 pysollib/main.py:253
msgid "%s installation error" msgid "%s installation error"
msgstr "" msgstr ""
@ -1270,7 +1291,7 @@ msgid ""
"Please check your %s installation.\n" "Please check your %s installation.\n"
msgstr "" msgstr ""
#: pysollib/main.py:72 pysollib/main.py:257 pysollib/tile/menubar.py:378 #: pysollib/main.py:72 pysollib/main.py:261 pysollib/tile/menubar.py:378
#: pysollib/tk/menubar.py:375 #: pysollib/tk/menubar.py:375
msgid "&Quit" msgid "&Quit"
msgstr "" msgstr ""
@ -1308,7 +1329,7 @@ msgid ""
"try %s --help for more information" "try %s --help for more information"
msgstr "" msgstr ""
#: pysollib/main.py:250 #: pysollib/main.py:254
msgid "" msgid ""
"\n" "\n"
"No games were found !!!\n" "No games were found !!!\n"
@ -1319,7 +1340,7 @@ msgid ""
"Please check your %s installation.\n" "Please check your %s installation.\n"
msgstr "" msgstr ""
#: pysollib/main.py:319 #: pysollib/main.py:323
msgid "Welcome to %s" msgid "Welcome to %s"
msgstr "" msgstr ""
@ -1603,7 +1624,7 @@ msgstr ""
msgid "any card" msgid "any card"
msgstr "" msgstr ""
#: pysollib/stack.py:1480 pysollib/util.py:86 #: pysollib/stack.py:1480 pysollib/util.py:85
msgid "Jack" msgid "Jack"
msgstr "" msgstr ""
@ -1651,7 +1672,7 @@ msgstr ""
msgid "Talon." msgid "Talon."
msgstr "" msgstr ""
#: pysollib/stack.py:2008 pysollib/stack.py:2537 #: pysollib/stack.py:2008 pysollib/stack.py:2542
msgid "Reserve. No building." msgid "Reserve. No building."
msgstr "" msgstr ""
@ -1798,7 +1819,7 @@ msgstr ""
msgid "Waste." msgid "Waste."
msgstr "" msgstr ""
#: pysollib/stack.py:2538 #: pysollib/stack.py:2543
msgid "Free cell." msgid "Free cell."
msgstr "" msgstr ""
@ -2048,7 +2069,7 @@ msgid "Large icons"
msgstr "" msgstr ""
#: pysollib/tile/menubar.py:120 pysollib/tk/menubar.py:119 #: pysollib/tile/menubar.py:120 pysollib/tk/menubar.py:119
msgid "Customize toolbar" msgid "Visible buttons"
msgstr "" msgstr ""
#: pysollib/tile/menubar.py:354 pysollib/tk/menubar.py:351 #: pysollib/tile/menubar.py:354 pysollib/tk/menubar.py:351
@ -3512,7 +3533,7 @@ msgstr ""
msgid "Player options" msgid "Player options"
msgstr "" msgstr ""
#: pysollib/tile/toolbar.py:395 pysollib/tk/toolbar.py:436 #: pysollib/tile/toolbar.py:399 pysollib/tk/toolbar.py:436
msgid "Toolbar" msgid "Toolbar"
msgstr "" msgstr ""
@ -3528,31 +3549,31 @@ msgstr ""
msgid "Enable samles" msgid "Enable samles"
msgstr "" msgstr ""
#: pysollib/util.py:81 #: pysollib/util.py:80
msgid "Club" msgid "Club"
msgstr "" msgstr ""
#: pysollib/util.py:81 #: pysollib/util.py:80
msgid "Diamond" msgid "Diamond"
msgstr "" msgstr ""
#: pysollib/util.py:81 #: pysollib/util.py:80
msgid "Heart" msgid "Heart"
msgstr "" msgstr ""
#: pysollib/util.py:81 #: pysollib/util.py:80
msgid "Spade" msgid "Spade"
msgstr "" msgstr ""
#: pysollib/util.py:82 #: pysollib/util.py:81
msgid "black" msgid "black"
msgstr "" msgstr ""
#: pysollib/util.py:82 #: pysollib/util.py:81
msgid "red" msgid "red"
msgstr "" msgstr ""
#: pysollib/util.py:107 #: pysollib/util.py:106
msgid "cardset" msgid "cardset"
msgstr "" msgstr ""

View file

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PySol 0.0.1\n" "Project-Id-Version: PySol 0.0.1\n"
"POT-Creation-Date: Thu Feb 15 18:35:01 2007\n" "POT-Creation-Date: Wed Feb 21 17:56:30 2007\n"
"PO-Revision-Date: 2007-02-12 19:08+0300\n" "PO-Revision-Date: 2007-02-12 19:08+0300\n"
"Last-Translator: Скоморох <skomoroh@gmail.com>\n" "Last-Translator: Скоморох <skomoroh@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n" "Language-Team: Russian <ru@li.org>\n"

View file

@ -5,8 +5,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PySol 0.0.1\n" "Project-Id-Version: PySol 0.0.1\n"
"POT-Creation-Date: Thu Feb 15 18:36:07 2007\n" "POT-Creation-Date: Wed Feb 21 17:57:33 2007\n"
"PO-Revision-Date: 2007-02-12 19:31+0300\n" "PO-Revision-Date: 2007-02-19 18:56+0300\n"
"Last-Translator: Скоморох <skomoroh@gmail.com>\n" "Last-Translator: Скоморох <skomoroh@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n" "Language-Team: Russian <ru@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -56,7 +56,7 @@ msgid "&Next number"
msgstr "&Следующий номер" msgstr "&Следующий номер"
#: pysollib/actions.py:315 pysollib/app.py:891 pysollib/app.py:1178 #: pysollib/actions.py:315 pysollib/app.py:891 pysollib/app.py:1178
#: pysollib/app.py:1190 pysollib/game.py:1010 pysollib/game.py:2245 #: pysollib/app.py:1190 pysollib/game.py:1012 pysollib/game.py:2247
#: pysollib/tile/colorsdialog.py:112 pysollib/tile/edittextdialog.py:83 #: pysollib/tile/colorsdialog.py:112 pysollib/tile/edittextdialog.py:83
#: pysollib/tile/fontsdialog.py:144 pysollib/tile/fontsdialog.py:204 #: pysollib/tile/fontsdialog.py:144 pysollib/tile/fontsdialog.py:204
#: pysollib/tile/gameinfodialog.py:155 pysollib/tile/menubar.py:1344 #: pysollib/tile/gameinfodialog.py:155 pysollib/tile/menubar.py:1344
@ -85,8 +85,8 @@ msgid "&OK"
msgstr "&ОК" msgstr "&ОК"
#: pysollib/actions.py:315 pysollib/app.py:892 pysollib/app.py:1190 #: pysollib/actions.py:315 pysollib/app.py:892 pysollib/app.py:1190
#: pysollib/game.py:1010 pysollib/game.py:1674 pysollib/game.py:1690 #: pysollib/game.py:1012 pysollib/game.py:1676 pysollib/game.py:1692
#: pysollib/game.py:1697 pysollib/game.py:1703 #: pysollib/game.py:1699 pysollib/game.py:1705
#: pysollib/tile/colorsdialog.py:112 pysollib/tile/edittextdialog.py:83 #: pysollib/tile/colorsdialog.py:112 pysollib/tile/edittextdialog.py:83
#: pysollib/tile/fontsdialog.py:144 pysollib/tile/fontsdialog.py:204 #: pysollib/tile/fontsdialog.py:144 pysollib/tile/fontsdialog.py:204
#: pysollib/tile/playeroptionsdialog.py:111 pysollib/tile/selectcardset.py:237 #: pysollib/tile/playeroptionsdialog.py:111 pysollib/tile/selectcardset.py:237
@ -267,8 +267,8 @@ msgstr "Настроить таймауты"
msgid "Unknown" msgid "Unknown"
msgstr "Неизвестный" msgstr "Неизвестный"
#: pysollib/app.py:893 pysollib/game.py:1674 pysollib/game.py:1690 #: pysollib/app.py:893 pysollib/game.py:1676 pysollib/game.py:1692
#: pysollib/game.py:1697 pysollib/game.py:1703 pysollib/tile/menubar.py:358 #: pysollib/game.py:1699 pysollib/game.py:1705 pysollib/tile/menubar.py:358
#: pysollib/tk/menubar.py:355 #: pysollib/tk/menubar.py:355
msgid "&New game" msgid "&New game"
msgstr "&Новая игра" msgstr "&Новая игра"
@ -307,15 +307,15 @@ msgstr ""
msgid "Please select a %s type %s" msgid "Please select a %s type %s"
msgstr "Выберите %s типа %s" msgstr "Выберите %s типа %s"
#: pysollib/game.py:929 pysollib/game.py:935 #: pysollib/game.py:931 pysollib/game.py:937
msgid "Player\n" msgid "Player\n"
msgstr "Игрок\n" msgstr "Игрок\n"
#: pysollib/game.py:1006 #: pysollib/game.py:1008
msgid "Discard current game ?" msgid "Discard current game ?"
msgstr "Завершить текущую игру?" msgstr "Завершить текущую игру?"
#: pysollib/game.py:1627 #: pysollib/game.py:1629
msgid "" msgid ""
"\n" "\n"
"You have reached\n" "You have reached\n"
@ -325,7 +325,7 @@ msgstr ""
"Вы достигли\n" "Вы достигли\n"
"#%d в %s игрового времени" "#%d в %s игрового времени"
#: pysollib/game.py:1632 #: pysollib/game.py:1634
msgid "" msgid ""
"\n" "\n"
"and #%d in the %s of moves" "and #%d in the %s of moves"
@ -333,7 +333,7 @@ msgstr ""
"\n" "\n"
"и #%d в %s количества ходов" "и #%d в %s количества ходов"
#: pysollib/game.py:1635 #: pysollib/game.py:1637
msgid "" msgid ""
"\n" "\n"
"You have reached\n" "You have reached\n"
@ -343,13 +343,13 @@ msgstr ""
"Вы достигли\n" "Вы достигли\n"
"#%d в %s количества ходов" "#%d в %s количества ходов"
#: pysollib/game.py:1665 pysollib/game.py:1682 #: pysollib/game.py:1667 pysollib/game.py:1684
#: pysollib/tile/soundoptionsdialog.py:102 #: pysollib/tile/soundoptionsdialog.py:102
#: pysollib/tk/soundoptionsdialog.py:100 #: pysollib/tk/soundoptionsdialog.py:100
msgid "Game won" msgid "Game won"
msgstr "Игра выиграна" msgstr "Игра выиграна"
#: pysollib/game.py:1666 #: pysollib/game.py:1668
msgid "" msgid ""
"\n" "\n"
"Congratulations, this\n" "Congratulations, this\n"
@ -368,7 +368,7 @@ msgstr ""
"Количество ходов: %s\n" "Количество ходов: %s\n"
"%s\n" "%s\n"
#: pysollib/game.py:1683 #: pysollib/game.py:1685
msgid "" msgid ""
"\n" "\n"
"Congratulations, you did it !\n" "Congratulations, you did it !\n"
@ -385,13 +385,13 @@ msgstr ""
"Количество ходов: %s\n" "Количество ходов: %s\n"
"%s\n" "%s\n"
#: pysollib/game.py:1695 pysollib/game.py:1701 #: pysollib/game.py:1697 pysollib/game.py:1703
#: pysollib/tile/soundoptionsdialog.py:100 #: pysollib/tile/soundoptionsdialog.py:100
#: pysollib/tk/soundoptionsdialog.py:98 #: pysollib/tk/soundoptionsdialog.py:98
msgid "Game finished" msgid "Game finished"
msgstr "Игра закончена" msgstr "Игра закончена"
#: pysollib/game.py:1696 pysollib/game.py:2246 #: pysollib/game.py:1698 pysollib/game.py:2248
msgid "" msgid ""
"\n" "\n"
"Game finished\n" "Game finished\n"
@ -399,7 +399,7 @@ msgstr ""
"\n" "\n"
"Игра закончена\n" "Игра закончена\n"
#: pysollib/game.py:1702 #: pysollib/game.py:1704
msgid "" msgid ""
"\n" "\n"
"Game finished, but not without my help...\n" "Game finished, but not without my help...\n"
@ -407,35 +407,35 @@ msgstr ""
"\n" "\n"
"Игра закончена, но не без моей помощи...\n" "Игра закончена, но не без моей помощи...\n"
#: pysollib/game.py:1703 #: pysollib/game.py:1705
msgid "&Restart" msgid "&Restart"
msgstr "&Начало" msgstr "&Начало"
#: pysollib/game.py:2135 #: pysollib/game.py:2137
msgid "Score %6d" msgid "Score %6d"
msgstr "Счёт %6d" msgstr "Счёт %6d"
#: pysollib/game.py:2237 #: pysollib/game.py:2239
msgid "&Cool" msgid "&Cool"
msgstr "&Отлично" msgstr "&Отлично"
#: pysollib/game.py:2237 #: pysollib/game.py:2239
msgid "&Great" msgid "&Great"
msgstr "&Здорово" msgstr "&Здорово"
#: pysollib/game.py:2237 #: pysollib/game.py:2239
msgid "&Wow" msgid "&Wow"
msgstr "&Ура" msgstr "&Ура"
#: pysollib/game.py:2237 #: pysollib/game.py:2239
msgid "&Yeah" msgid "&Yeah"
msgstr "&Ага" msgstr "&Ага"
#: pysollib/game.py:2238 pysollib/game.py:2249 pysollib/game.py:2261 #: pysollib/game.py:2240 pysollib/game.py:2251 pysollib/game.py:2263
msgid " Autopilot" msgid " Autopilot"
msgstr " Автопилот" msgstr " Автопилот"
#: pysollib/game.py:2239 #: pysollib/game.py:2241
msgid "" msgid ""
"\n" "\n"
"Game solved in %d moves.\n" "Game solved in %d moves.\n"
@ -443,19 +443,19 @@ msgstr ""
"\n" "\n"
"Игра решена за %d ходов\n" "Игра решена за %d ходов\n"
#: pysollib/game.py:2260 #: pysollib/game.py:2262
msgid "&Hmm" msgid "&Hmm"
msgstr "&Хмм" msgstr "&Хмм"
#: pysollib/game.py:2260 #: pysollib/game.py:2262
msgid "&Oh well" msgid "&Oh well"
msgstr "&Ох" msgstr "&Ох"
#: pysollib/game.py:2260 #: pysollib/game.py:2262
msgid "&That's life" msgid "&That's life"
msgstr "&Такова жизнь" msgstr "&Такова жизнь"
#: pysollib/game.py:2262 #: pysollib/game.py:2264
msgid "" msgid ""
"\n" "\n"
"This won't come out...\n" "This won't come out...\n"
@ -463,31 +463,31 @@ msgstr ""
"\n" "\n"
"Не удалось...\n" "Не удалось...\n"
#: pysollib/game.py:2702 #: pysollib/game.py:2704
msgid "Set bookmark" msgid "Set bookmark"
msgstr "Установить закладку" msgstr "Установить закладку"
#: pysollib/game.py:2703 #: pysollib/game.py:2705
msgid "Replace existing bookmark %d ?" msgid "Replace existing bookmark %d ?"
msgstr "Заменить существующую закладку %d ?" msgstr "Заменить существующую закладку %d ?"
#: pysollib/game.py:2725 #: pysollib/game.py:2727
msgid "Goto bookmark" msgid "Goto bookmark"
msgstr "Перейти к закладке" msgstr "Перейти к закладке"
#: pysollib/game.py:2726 #: pysollib/game.py:2728
msgid "Goto bookmark %d ?" msgid "Goto bookmark %d ?"
msgstr "Перейти к закладке %d ?" msgstr "Перейти к закладке %d ?"
#: pysollib/game.py:2757 #: pysollib/game.py:2759
msgid "Open game" msgid "Open game"
msgstr "Открыть игру" msgstr "Открыть игру"
#: pysollib/game.py:2768 pysollib/game.py:2777 pysollib/game.py:2782 #: pysollib/game.py:2770 pysollib/game.py:2780 pysollib/game.py:2785
msgid "Load game error" msgid "Load game error"
msgstr "Ошибка при загрузке игры" msgstr "Ошибка при загрузке игры"
#: pysollib/game.py:2769 #: pysollib/game.py:2771
msgid "" msgid ""
"Error while loading game.\n" "Error while loading game.\n"
"\n" "\n"
@ -499,11 +499,11 @@ msgstr ""
"Возможно повреждён файл,\n" "Возможно повреждён файл,\n"
"или ошибка в программе." "или ошибка в программе."
#: pysollib/game.py:2778 #: pysollib/game.py:2781
msgid "Error while loading game" msgid "Error while loading game"
msgstr "Ошибка при загрузке игры" msgstr "Ошибка при загрузке игры"
#: pysollib/game.py:2783 #: pysollib/game.py:2786
msgid "" msgid ""
"Internal error while loading game.\n" "Internal error while loading game.\n"
"\n" "\n"
@ -513,14 +513,31 @@ msgstr ""
"\n" "\n"
"Пожалуйста сообщите об этой ошибке." "Пожалуйста сообщите об этой ошибке."
#: pysollib/game.py:2808 #: pysollib/game.py:2815
msgid "Save game error" msgid "Save game error"
msgstr "Ошибка при сохранении игры" msgstr "Ошибка при сохранении игры"
#: pysollib/game.py:2809 #: pysollib/game.py:2816
msgid "Error while saving game" msgid "Error while saving game"
msgstr "Ошибка при сохранении игры" msgstr "Ошибка при сохранении игры"
#: pysollib/game.py:2841
msgid "Invalid or damaged %s save file"
msgstr ""
#: pysollib/game.py:2855
msgid ""
"Cannot load games saved with\n"
"%s version %s"
msgstr ""
#: pysollib/game.py:2872
msgid ""
"Cannot load this game from version %s\n"
"as the game rules have changed\n"
"in the current implementation."
msgstr ""
#: pysollib/gamedb.py:121 #: pysollib/gamedb.py:121
msgid "Baker's Dozen" msgid "Baker's Dozen"
msgstr "" msgstr ""
@ -768,12 +785,12 @@ msgstr ""
"4: 8 Д 3 7 В 2 6 10 Т 5 9 К" "4: 8 Д 3 7 В 2 6 10 Т 5 9 К"
#: pysollib/games/canfield.py:528 pysollib/games/special/tarock.py:224 #: pysollib/games/canfield.py:528 pysollib/games/special/tarock.py:224
#: pysollib/stack.py:1482 pysollib/util.py:86 #: pysollib/stack.py:1482 pysollib/util.py:85
msgid "King" msgid "King"
msgstr "Король" msgstr "Король"
#: pysollib/games/canfield.py:531 pysollib/games/special/tarock.py:224 #: pysollib/games/canfield.py:531 pysollib/games/special/tarock.py:224
#: pysollib/stack.py:1481 pysollib/util.py:86 #: pysollib/stack.py:1481 pysollib/util.py:85
msgid "Queen" msgid "Queen"
msgstr "Королева" msgstr "Королева"
@ -790,6 +807,11 @@ msgstr "Снять"
msgid "X" msgid "X"
msgstr "Х" msgstr "Х"
#: pysollib/games/fan.py:470
#, fuzzy
msgid "Base card - Ace or King."
msgstr "Базовая карта - %s."
#: pysollib/games/golf.py:114 pysollib/games/golf.py:302 #: pysollib/games/golf.py:114 pysollib/games/golf.py:302
#: pysollib/stack.py:2145 #: pysollib/stack.py:2145
msgid "Tableau. No building." msgid "Tableau. No building."
@ -800,15 +822,15 @@ msgstr "Игровой стол. Без выкладывания."
msgid "Foundation. Build up regardless of suit." msgid "Foundation. Build up regardless of suit."
msgstr "Базовая ячейка. Складывать по возрастанию не считаясь с мастью." msgstr "Базовая ячейка. Складывать по возрастанию не считаясь с мастью."
#: pysollib/games/klondike.py:112 #: pysollib/games/klondike.py:113
msgid "Balance $%d" msgid "Balance $%d"
msgstr "Баланс $%d" msgstr "Баланс $%d"
#: pysollib/games/klondike.py:169 pysollib/stack.py:2186 #: pysollib/games/klondike.py:170 pysollib/stack.py:2186
msgid "Tableau. Build down by color." msgid "Tableau. Build down by color."
msgstr "Игровой стол. Складывать по убыванию в соответствии с цветом." msgstr "Игровой стол. Складывать по убыванию в соответствии с цветом."
#: pysollib/games/klondike.py:438 #: pysollib/games/klondike.py:444
msgid "Reserve. Only Kings are acceptable." msgid "Reserve. Only Kings are acceptable."
msgstr "Резерв. Только для королей." msgstr "Резерв. Только для королей."
@ -941,7 +963,7 @@ msgstr "Жезлы"
#: pysollib/games/special/tarock.py:223 #: pysollib/games/special/tarock.py:223
#: pysollib/games/ultra/dashavatara.py:351 #: pysollib/games/ultra/dashavatara.py:351
#: pysollib/games/ultra/hexadeck.py:273 pysollib/games/ultra/mughal.py:254 #: pysollib/games/ultra/hexadeck.py:273 pysollib/games/ultra/mughal.py:254
#: pysollib/stack.py:1483 pysollib/util.py:85 #: pysollib/stack.py:1483 pysollib/util.py:84
msgid "Ace" msgid "Ace"
msgstr "Туз" msgstr "Туз"
@ -1358,7 +1380,7 @@ msgstr "Не найден файл помощи\n"
msgid " Help" msgid " Help"
msgstr " Помощь" msgstr " Помощь"
#: pysollib/main.py:64 pysollib/main.py:249 #: pysollib/main.py:64 pysollib/main.py:253
msgid "%s installation error" msgid "%s installation error"
msgstr "%s проблема с установкой" msgstr "%s проблема с установкой"
@ -1378,7 +1400,7 @@ msgstr ""
"\n" "\n"
"Пожалуйста проверьте установку %s.\n" "Пожалуйста проверьте установку %s.\n"
#: pysollib/main.py:72 pysollib/main.py:257 pysollib/tile/menubar.py:378 #: pysollib/main.py:72 pysollib/main.py:261 pysollib/tile/menubar.py:378
#: pysollib/tk/menubar.py:375 #: pysollib/tk/menubar.py:375
msgid "&Quit" msgid "&Quit"
msgstr "В&ыход" msgstr "В&ыход"
@ -1433,7 +1455,7 @@ msgstr ""
"%s: неправильное имя файла\n" "%s: неправильное имя файла\n"
"попробуйте %s --help для получения более подробной информации" "попробуйте %s --help для получения более подробной информации"
#: pysollib/main.py:250 #: pysollib/main.py:254
msgid "" msgid ""
"\n" "\n"
"No games were found !!!\n" "No games were found !!!\n"
@ -1451,7 +1473,7 @@ msgstr ""
"\n" "\n"
"Пожалуйста проверьте установку %s.\n" "Пожалуйста проверьте установку %s.\n"
#: pysollib/main.py:319 #: pysollib/main.py:323
msgid "Welcome to %s" msgid "Welcome to %s"
msgstr "Добро пожаловать в %s" msgstr "Добро пожаловать в %s"
@ -1735,7 +1757,7 @@ msgstr "Пустой ряд не заполняется."
msgid "any card" msgid "any card"
msgstr "любая карта" msgstr "любая карта"
#: pysollib/stack.py:1480 pysollib/util.py:86 #: pysollib/stack.py:1480 pysollib/util.py:85
msgid "Jack" msgid "Jack"
msgstr "Валет" msgstr "Валет"
@ -1783,7 +1805,7 @@ msgstr " пересдачи."
msgid "Talon." msgid "Talon."
msgstr "Колода." msgstr "Колода."
#: pysollib/stack.py:2008 pysollib/stack.py:2537 #: pysollib/stack.py:2008 pysollib/stack.py:2542
msgid "Reserve. No building." msgid "Reserve. No building."
msgstr "Резерв. Без выкладывания." msgstr "Резерв. Без выкладывания."
@ -1951,7 +1973,7 @@ msgstr ""
msgid "Waste." msgid "Waste."
msgstr "Сброс." msgstr "Сброс."
#: pysollib/stack.py:2538 #: pysollib/stack.py:2543
msgid "Free cell." msgid "Free cell."
msgstr "Свободная ячейка." msgstr "Свободная ячейка."
@ -2201,8 +2223,8 @@ msgid "Large icons"
msgstr "Большие пиктограммы" msgstr "Большие пиктограммы"
#: pysollib/tile/menubar.py:120 pysollib/tk/menubar.py:119 #: pysollib/tile/menubar.py:120 pysollib/tk/menubar.py:119
msgid "Customize toolbar" msgid "Visible buttons"
msgstr "Настроить панель инструментов" msgstr "Показывать кнопки"
#: pysollib/tile/menubar.py:354 pysollib/tk/menubar.py:351 #: pysollib/tile/menubar.py:354 pysollib/tk/menubar.py:351
#, fuzzy #, fuzzy
@ -3692,7 +3714,7 @@ msgstr "Игрок"
msgid "Player options" msgid "Player options"
msgstr "Установки игрока" msgstr "Установки игрока"
#: pysollib/tile/toolbar.py:395 pysollib/tk/toolbar.py:436 #: pysollib/tile/toolbar.py:399 pysollib/tk/toolbar.py:436
msgid "Toolbar" msgid "Toolbar"
msgstr "Панель инструментов" msgstr "Панель инструментов"
@ -3708,31 +3730,31 @@ msgstr "Выбрать имя"
msgid "Enable samles" msgid "Enable samles"
msgstr "Включить звуки" msgstr "Включить звуки"
#: pysollib/util.py:81 #: pysollib/util.py:80
msgid "Club" msgid "Club"
msgstr "Треф" msgstr "Треф"
#: pysollib/util.py:81 #: pysollib/util.py:80
msgid "Diamond" msgid "Diamond"
msgstr "Буби" msgstr "Буби"
#: pysollib/util.py:81 #: pysollib/util.py:80
msgid "Heart" msgid "Heart"
msgstr "Черви" msgstr "Черви"
#: pysollib/util.py:81 #: pysollib/util.py:80
msgid "Spade" msgid "Spade"
msgstr "Пики" msgstr "Пики"
#: pysollib/util.py:82 #: pysollib/util.py:81
msgid "black" msgid "black"
msgstr "чёрный" msgstr "чёрный"
#: pysollib/util.py:82 #: pysollib/util.py:81
msgid "red" msgid "red"
msgstr "красный" msgstr "красный"
#: pysollib/util.py:107 #: pysollib/util.py:106
msgid "cardset" msgid "cardset"
msgstr "набор карт" msgstr "набор карт"
@ -3752,6 +3774,9 @@ msgstr "Всего ходов"
msgid "Set font" msgid "Set font"
msgstr "Настроить шрифт" msgstr "Настроить шрифт"
#~ msgid "Customize toolbar"
#~ msgstr "Настроить панель инструментов"
#~ msgid "&Timer based" #~ msgid "&Timer based"
#~ msgstr "Базирующаяся на &таймере" #~ msgstr "Базирующаяся на &таймере"

View file

@ -104,7 +104,7 @@ class Options:
self.mahjongg_show_removed = False self.mahjongg_show_removed = False
self.mahjongg_create_solvable = True self.mahjongg_create_solvable = True
self.shisen_show_hint = True self.shisen_show_hint = True
self.animations = 2 # default to Fast self.animations = 2 # default to Fast
self.redeal_animation = True self.redeal_animation = True
self.win_animation = True self.win_animation = True
self.shadow = True self.shadow = True
@ -128,11 +128,11 @@ class Options:
if WIN_SYSTEM == 'win32': if WIN_SYSTEM == 'win32':
self.toolbar_style = 'crystal' self.toolbar_style = 'crystal'
self.toolbar_relief = 'flat' self.toolbar_relief = 'flat'
self.toolbar_compound = 'none' # icons only self.toolbar_compound = 'none' # icons only
self.toolbar_size = 0 self.toolbar_size = 0
self.toolbar_vars = {} self.toolbar_vars = {}
for w in TOOLBAR_BUTTONS: for w in TOOLBAR_BUTTONS:
self.toolbar_vars[w] = True self.toolbar_vars[w] = True # show all buttons
self.statusbar = True self.statusbar = True
self.num_cards = False self.num_cards = False
self.helpbar = False self.helpbar = False
@ -219,7 +219,7 @@ class Options:
self.mouse_undo = False # use mouse for undo/redo self.mouse_undo = False # use mouse for undo/redo
self.negative_bottom = True self.negative_bottom = True
self.randomize_place = False self.randomize_place = False
self.cache_cardsets = True self.save_cardsets = True
# defaults & constants # defaults & constants
self.setDefaults() self.setDefaults()
self.setConstants() self.setConstants()
@ -1045,7 +1045,7 @@ class Application:
if not images.load(app=self, progress=progress): if not images.load(app=self, progress=progress):
raise Exception("Invalid or damaged "+CARDSET) raise Exception("Invalid or damaged "+CARDSET)
simages = SubsampledImages(images) simages = SubsampledImages(images)
if self.opt.cache_cardsets: if self.opt.save_cardsets:
c = self.cardsets_cache.get(cs.type) c = self.cardsets_cache.get(cs.type)
if c: if c:
##c[1].destruct() ##c[1].destruct()
@ -1233,7 +1233,7 @@ Please select a %s type %s.
def __saveObject(self, obj, fn): def __saveObject(self, obj, fn):
obj.version_tuple = VERSION_TUPLE obj.version_tuple = VERSION_TUPLE
obj.saved = obj.saved + 1 obj.saved = obj.saved + 1
pickle(obj, fn, binmode=1) pickle(obj, fn, protocol=-1)
def saveOptions(self): def saveOptions(self):
self.__saveObject(self.opt, self.fn.opt) self.__saveObject(self.opt, self.fn.opt)

View file

@ -38,6 +38,7 @@
import time import time
import math import math
import md5 import md5
import traceback
from cStringIO import StringIO from cStringIO import StringIO
# PySol imports # PySol imports
@ -46,8 +47,9 @@ from mfxutil import Image, ImageTk
from mfxutil import destruct, Struct, SubclassResponsibility from mfxutil import destruct, Struct, SubclassResponsibility
from mfxutil import uclock, usleep from mfxutil import uclock, usleep
from mfxutil import format_time from mfxutil import format_time
from util import get_version_tuple, Timer from util import Timer
from settings import PACKAGE, TOOLKIT, TOP_TITLE, VERSION, VERSION_TUPLE from settings import PACKAGE, TOOLKIT, TOP_TITLE
from settings import VERSION, VERSION_TUPLE, FC_VERSION
from settings import DEBUG from settings import DEBUG
from gamedb import GI from gamedb import GI
from pysolrandom import PysolRandom, LCRandom31 from pysolrandom import PysolRandom, LCRandom31
@ -2771,6 +2773,7 @@ Error while loading game.
Probably the game file is damaged, 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()
except (Exception, UnpicklingError), ex: except (Exception, UnpicklingError), ex:
self.updateMenus() self.updateMenus()
self.setCursor(cursor=self.app.top_cursor) self.setCursor(cursor=self.app.top_cursor)
@ -2779,12 +2782,16 @@ but this could also be a bug you might want to report."""))
except: except:
self.updateMenus() self.updateMenus()
self.setCursor(cursor=self.app.top_cursor) self.setCursor(cursor=self.app.top_cursor)
d = MfxMessageDialog(self.top, title=_("Load game error"), bitmap="error", d = MfxMessageDialog(self.top, title=_("Load game error"),
text=_("""\ bitmap="error", text=_("""\
Internal error while loading game. Internal error while loading game.
Please report this bug.""")) Please report this bug."""))
traceback.print_exc()
else: else:
if self.pause:
# unselect pause-button
self.app.menubar.mPause()
self.filename = filename self.filename = filename
game.filename = filename game.filename = filename
# now start the new game # now start the new game
@ -2798,11 +2805,11 @@ Please report this bug."""))
self.quitGame(game.id, loadedgame=game) self.quitGame(game.id, loadedgame=game)
def saveGame(self, filename, binmode=1): def saveGame(self, filename, protocol=-1):
self.finishMove() # just in case self.finishMove() # just in case
self.setCursor(cursor=CURSOR_WATCH) self.setCursor(cursor=CURSOR_WATCH)
try: try:
self._saveGame(filename, binmode) self._saveGame(filename, protocol)
except Exception, ex: except Exception, ex:
self.setCursor(cursor=self.app.top_cursor) self.setCursor(cursor=self.app.top_cursor)
d = MfxExceptionDialog(self.top, ex, title=_("Save game error"), d = MfxExceptionDialog(self.top, ex, title=_("Save game error"),
@ -2828,18 +2835,10 @@ Please report this bug."""))
if f: f.close() if f: f.close()
return game return game
def _getUndumpVersion(self, version_tuple):
if version_tuple > (4, 41): return 4
if version_tuple > (4, 30): return 3
if version_tuple > (4, 20): return 2
if version_tuple > (3, 20): return 1
if version_tuple >= (2, 99): return 0
return -1
def _undumpGame(self, p, app): def _undumpGame(self, p, app):
self.updateTime() self.updateTime()
# #
err_txt = "Invalid or damaged %s save file" % PACKAGE err_txt = _("Invalid or damaged %s save file") % PACKAGE
# #
def pload(t=None, p=p): def pload(t=None, p=p):
obj = p.load() obj = p.load()
@ -2847,46 +2846,37 @@ Please report this bug."""))
assert isinstance(obj, t), err_txt assert isinstance(obj, t), err_txt
return obj return obj
# #
package = pload() package = pload(str)
assert isinstance(package, str) and package == PACKAGE, err_txt assert package == PACKAGE, err_txt
version = pload() version = pload(str)
assert isinstance(version, str) and len(version) <= 20, err_txt #assert isinstance(version, str) and len(version) <= 20, err_txt
version_tuple = get_version_tuple(version) version_tuple = pload(tuple)
v = self._getUndumpVersion(version_tuple) if version_tuple < (10,):
assert v >= 0 and version_tuple <= VERSION_TUPLE, \ raise UnpicklingError(_('''\
"Cannot load games saved with\n"+PACKAGE+" version "+version Cannot load games saved with
%s version %s''') % (PACKAGE, version))
game_version = 1 game_version = 1
bookmark = 0 bookmark = pload(int)
if v >= 2: assert 0 <= bookmark <= 2, err_txt
vt = pload() game_version = pload(int)
assert isinstance(vt, tuple) and vt == version_tuple, err_txt assert game_version > 0, err_txt
bookmark = pload()
assert isinstance(bookmark, int) and 0 <= bookmark <= 2, \
"Incompatible savegame format"
game_version = pload()
assert isinstance(game_version, int) and game_version > 0, err_txt
if v <= 3:
bookmark = 0
# #
id = pload() id = pload(int)
assert isinstance(id, int) and id > 0, err_txt assert id > 0, err_txt
if id not in GI.PROTECTED_GAMES: if id not in GI.PROTECTED_GAMES:
game = app.constructGame(id) game = app.constructGame(id)
if game: if game:
if not game.canLoadGame(version_tuple, game_version): if not game.canLoadGame(version_tuple, game_version):
destruct(game) destruct(game)
game = None game = None
assert game is not None, '''\ assert game is not None, _('''\
Cannot load this game from version %s Cannot load this game from version %s
as the game rules have changed as the game rules have changed
in the current implementation.''' % version in the current implementation.''') % version
game.version = version game.version = version
game.version_tuple = version_tuple game.version_tuple = version_tuple
# #
#game.random = pload() initial_seed = pload(long)
#assert isinstance(game.random, PysolRandom), err_txt
initial_seed = pload()
assert isinstance(initial_seed, long)
if initial_seed <= 32000: if initial_seed <= 32000:
game.random = LCRandom31(initial_seed) game.random = LCRandom31(initial_seed)
else: else:
@ -2897,12 +2887,12 @@ in the current implementation.''' % version
# game.random.origin = game.random.ORIGIN_UNKNOWN # game.random.origin = game.random.ORIGIN_UNKNOWN
game.loadinfo.stacks = [] game.loadinfo.stacks = []
game.loadinfo.ncards = 0 game.loadinfo.ncards = 0
nstacks = pload() nstacks = pload(int)
assert isinstance(nstacks, int) and 1 <= nstacks, err_txt assert 1 <= nstacks, err_txt
for i in range(nstacks): for i in range(nstacks):
stack = [] stack = []
ncards = pload() ncards = pload(int)
assert isinstance(ncards, int) and 0 <= ncards <= 1024, err_txt assert 0 <= ncards <= 1024, err_txt
for j in range(ncards): for j in range(ncards):
card_id = pload(int) card_id = pload(int)
face_up = pload(int) face_up = pload(int)
@ -2913,34 +2903,22 @@ in the current implementation.''' % version
game.loadinfo.talon_round = pload() game.loadinfo.talon_round = pload()
game.finished = pload() game.finished = pload()
if 0 <= bookmark <= 1: if 0 <= bookmark <= 1:
if v >= 3: saveinfo = pload(Struct)
saveinfo = pload() game.saveinfo.__dict__.update(saveinfo.__dict__)
assert isinstance(saveinfo, Struct), err_txt gsaveinfo = pload(Struct)
game.saveinfo.__dict__.update(saveinfo.__dict__) game.gsaveinfo.__dict__.update(gsaveinfo.__dict__)
if v >= 4: moves = pload(Struct)
gsaveinfo = pload()
assert isinstance(gsaveinfo, Struct), err_txt
game.gsaveinfo.__dict__.update(gsaveinfo.__dict__)
elif v >= 1:
# not used
talon_base_cards = pload(list)
moves = pload()
assert isinstance(moves, Struct), err_txt
game.moves.__dict__.update(moves.__dict__) game.moves.__dict__.update(moves.__dict__)
snapshots = p.load() snapshots = pload(list)
assert isinstance(snapshots, list), err_txt
game.snapshots = snapshots game.snapshots = snapshots
if 0 <= bookmark <= 1: if 0 <= bookmark <= 1:
gstats = pload() gstats = pload(Struct)
assert isinstance(gstats, Struct), err_txt
game.gstats.__dict__.update(gstats.__dict__) game.gstats.__dict__.update(gstats.__dict__)
stats = pload() stats = pload(Struct)
assert isinstance(stats, Struct), err_txt
game.stats.__dict__.update(stats.__dict__) game.stats.__dict__.update(stats.__dict__)
game._loadGameHook(p) game._loadGameHook(p)
if v >= 4: dummy = pload(str)
dummy = pload(str) assert dummy == "EOF", err_txt
assert dummy == "EOF", err_txt
if bookmark == 2: if bookmark == 2:
# copy back all variables that are not saved # copy back all variables that are not saved
game.stats = self.stats game.stats = self.stats
@ -2949,13 +2927,13 @@ in the current implementation.''' % version
game.gsaveinfo = self.gsaveinfo game.gsaveinfo = self.gsaveinfo
return game return game
def _saveGame(self, filename, binmode=1): def _saveGame(self, filename, protocol=-1):
f = None f = None
try: try:
if not self.canSaveGame(): if not self.canSaveGame():
raise Exception("Cannot save this game.") raise Exception("Cannot save this game.")
f = open(filename, "wb") f = open(filename, "wb")
p = Pickler(f, binmode) p = Pickler(f, protocol)
self._dumpGame(p) self._dumpGame(p)
finally: finally:
if f: f.close() if f: f.close()
@ -2964,13 +2942,12 @@ in the current implementation.''' % version
self.updateTime() self.updateTime()
assert 0 <= bookmark <= 2 assert 0 <= bookmark <= 2
p.dump(PACKAGE) p.dump(PACKAGE)
p.dump(VERSION) p.dump(FC_VERSION)
p.dump(VERSION_TUPLE) p.dump(VERSION_TUPLE)
p.dump(bookmark) p.dump(bookmark)
p.dump(self.GAME_VERSION) p.dump(self.GAME_VERSION)
p.dump(self.id) p.dump(self.id)
# #
#p.dump(self.random)
p.dump(self.random.initial_seed) p.dump(self.random.initial_seed)
p.dump(self.random.getstate()) p.dump(self.random.getstate())
# #

View file

@ -204,7 +204,11 @@ def pysol_init(app, args):
app.top_cursor = top.cget("cursor") app.top_cursor = top.cget("cursor")
# load options # load options
app.loadOptions() try:
app.loadOptions()
except:
traceback.print_exc()
pass
# init audio 1) # init audio 1)
app.audio = None app.audio = None

View file

@ -100,22 +100,6 @@ def latin1_to_ascii(n):
.replace("\xfc", "ue")) .replace("\xfc", "ue"))
return n return n
## import htmlentitydefs
## htmlentitydefs_i = {}
## def latin1_to_html(n):
## global htmlentitydefs_i
## if not htmlentitydefs_i:
## for k, v in htmlentitydefs.entitydefs.items():
## htmlentitydefs_i[v] = "&" + k + ";"
## s, g = "", htmlentitydefs_i.get
## for c in n:
## s = s + g(c, c)
## return s
## def hexify(s):
## return "%02x"*len(s) % tuple(map(ord, s))
def format_time(t): def format_time(t):
##print 'format_time:', t ##print 'format_time:', t
@ -288,11 +272,11 @@ class KwStruct:
# // pickling support # // pickling support
# ************************************************************************/ # ************************************************************************/
def pickle(obj, filename, binmode=0): def pickle(obj, filename, protocol=0):
f = None f = None
try: try:
f = open(filename, "wb") f = open(filename, "wb")
p = Pickler(f, binmode) p = Pickler(f, protocol)
p.dump(obj) p.dump(obj)
f.close(); f = None f.close(); f = None
##print "Pickled", filename ##print "Pickled", filename

View file

@ -30,7 +30,7 @@ PACKAGE_URL = 'http://sourceforge.net/projects/pysolfc/'
VERSION = '4.82' VERSION = '4.82'
FC_VERSION = '1.0' FC_VERSION = '1.0'
VERSION_TUPLE = (4, 82) VERSION_TUPLE = (10, 0)
# Tk windowing system (auto determine in init.py) # Tk windowing system (auto determine in init.py)
WIN_SYSTEM = 'x11' # win32, x11, aqua, classic WIN_SYSTEM = 'x11' # win32, x11, aqua, classic

View file

@ -117,7 +117,7 @@ def createToolbarMenu(menubar, menu):
# #
#return #return
menu.add_separator() menu.add_separator()
submenu = MfxMenu(menu, label=n_('Customize toolbar'), tearoff=tearoff) submenu = MfxMenu(menu, label=n_('Visible buttons'), tearoff=tearoff)
for w in TOOLBAR_BUTTONS: for w in TOOLBAR_BUTTONS:
submenu.add_checkbutton(label=gettext(w.capitalize()), submenu.add_checkbutton(label=gettext(w.capitalize()),
variable=menubar.tkopt.toolbar_vars[w], variable=menubar.tkopt.toolbar_vars[w],

View file

@ -63,10 +63,10 @@ from tkFont import Font
# PySol imports # PySol imports
from pysollib.mfxutil import Image, ImageTk, ImageOps from pysollib.mfxutil import Image, ImageTk, ImageOps
from pysollib.settings import PACKAGE, WIN_SYSTEM
# Toolkit imports # Toolkit imports
from tkconst import tkversion from tkconst import tkversion
from pysollib.settings import PACKAGE, WIN_SYSTEM
# /*********************************************************************** # /***********************************************************************

View file

@ -116,7 +116,7 @@ def createToolbarMenu(menubar, menu):
# #
#return #return
menu.add_separator() menu.add_separator()
submenu = MfxMenu(menu, label=n_('Customize toolbar'), tearoff=tearoff) submenu = MfxMenu(menu, label=n_('Visible buttons'), tearoff=tearoff)
for w in TOOLBAR_BUTTONS: for w in TOOLBAR_BUTTONS:
submenu.add_checkbutton(label=gettext(w.capitalize()), submenu.add_checkbutton(label=gettext(w.capitalize()),
variable=menubar.tkopt.toolbar_vars[w], variable=menubar.tkopt.toolbar_vars[w],

View file

@ -63,10 +63,10 @@ from tkFont import Font
# PySol imports # PySol imports
from pysollib.mfxutil import Image, ImageTk, ImageOps from pysollib.mfxutil import Image, ImageTk, ImageOps
from pysollib.settings import PACKAGE, WIN_SYSTEM
# Toolkit imports # Toolkit imports
from tkconst import tkversion from tkconst import tkversion
from pysollib.settings import PACKAGE, WIN_SYSTEM
# /*********************************************************************** # /***********************************************************************

View file

@ -54,7 +54,6 @@ __all__ = ['SUITS',
'VARIABLE_REDEALS', 'VARIABLE_REDEALS',
'CARDSET', 'CARDSET',
'IMAGE_EXTENSIONS', 'IMAGE_EXTENSIONS',
'get_version_tuple',
'Timer', 'Timer',
'DataLoader', 'DataLoader',
] ]
@ -115,17 +114,6 @@ if Image:
IMAGE_EXTENSIONS = (".png", ".gif", ".jpg", ".ppm", ".bmp") IMAGE_EXTENSIONS = (".png", ".gif", ".jpg", ".ppm", ".bmp")
def get_version_tuple(version_string):
v = re.split(r"[^\d\.]", version_string)
if not v or not v[0]:
return (0,)
v = v[0].split(".")
v = filter(lambda x: x != "", v)
if not v or not v[0]:
return (0,)
return tuple(map(int, v))
# /*********************************************************************** # /***********************************************************************
# // simple benchmarking # // simple benchmarking
# ************************************************************************/ # ************************************************************************/

View file

@ -21,7 +21,8 @@
import sys, os, traceback import sys, os, traceback
from pysollib.settings import PACKAGE, VERSION from pysollib.settings import PACKAGE
from pysollib.settings import FC_VERSION as VERSION
from pysollib.settings import TOOLKIT, USE_TILE from pysollib.settings import TOOLKIT, USE_TILE
from pysollib.settings import DEBUG from pysollib.settings import DEBUG
from pysollib.tile import Tile from pysollib.tile import Tile