/usr/share/pyshared/pychess/widgets/tipOfTheDay.py is in pychess 0.12~beta3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | import os
from pychess.System import conf
from pychess.System import uistuff
from pychess.System.prefix import addDataPrefix
from random import randrange
uistuff.cacheGladefile("tipoftheday.glade")
class TipOfTheDay:
@classmethod
def _init (cls):
cls.widgets = uistuff.GladeWidgets("tipoftheday.glade")
uistuff.keepWindowSize("tipoftheday", cls.widgets["window1"],
(320,240), uistuff.POSITION_CENTER)
cls.widgets["checkbutton1"].set_active(conf.get("show_tip_at_startup", False))
cls.widgets["checkbutton1"].connect("toggled",
lambda w: conf.set("show_tip_at_startup", w.get_active()))
cls.widgets["close_button"].connect("clicked",
lambda w: cls.widgets["window1"].emit("delete-event", None))
cls.widgets["window1"].connect("delete_event",
lambda w, a: cls.widgets["window1"].hide())
cls.widgets["back_button"].connect("clicked",
lambda w: cls.set_currentIndex(cls.currentIndex-1))
cls.widgets["forward_button"].connect("clicked",
lambda w: cls.set_currentIndex(cls.currentIndex+1))
cls.currentIndex = 0
@classmethod
def show (cls):
if not hasattr(cls, "widgets"):
cls._init()
cls.set_currentIndex(randrange(len(tips)))
cls.widgets["window1"].show()
@classmethod
def set_currentIndex (cls, value):
if len(tips) == 0: return
if value < 0: value = len(tips)-1
elif value >= len(tips): value = 0
cls.currentIndex = value
cls.widgets["tipfield"].set_markup(tips[value])
tips = (
_("You can start a new game by <b>Game</b> > <b>New Game</b>, in New Game window do you can choose <b>Players</b>, <b>Time Control</b> and <b>Chess Variants</b>."),
_("You can choose from 8 different difficulties to play against the computer."),
_("Chess Variants are like the pieces of the last line will be placed on the board."),
_("To save a game <b>Game</b> > <b>Save Game As</b>, give the filename and choose where you want to be saved. At the bottom choose extension type of the file, and <b>Save</b>."),
_("Do you know that you can call flag when the clock is with you, <b>Actions</b> > <b>Call Flag</b>."),
_("Pressing <b>Ctrl+Z</b> to offer opponent the possible rollback moves."),
_("To play on <b>Fullscreen mode</b>, just type <b>F11</b>. Coming back, F11 again."),
_("<b>Hint mode</b> analyzing your game, enable this type <b>Ctrl+H</b>."),
_("<b>Spy mode</b> analyzing the oponnent game, enable this type <b>Ctrl+Y</b>."),
_("You can play chess listening to the sounds of the game, for that, <b>Settings</b> > <b>Preferences</b> > <b>Sound tab</b>, enable <b>Use sounds in PyChess</b> and choose your preferred sounds."),
_("Do you know that you can help translate Pychess in your language, <b>Help</b> > <b>Translate Pychess</b>."),
_("Do you know that it is possible to finish a chess game in just 2 turns?"),
_("Do you know that the number of possible chess games exceeds the number of atoms in the Universe?"),
)
|