~ubuntu-branches/ubuntu/intrepid/gnome-games/intrepid

« back to all changes in this revision

Viewing changes to glchess/src/glchess.in.in

  • Committer: Package Import Robot
  • Author(s): Didier Roche
  • Date: 2008-10-21 00:30:34 UTC
  • mfrom: (1.1.58)
  • Revision ID: package-import@ubuntu.com-20081021003034-cb0iknvzten935zn
Tags: 1:2.24.1-0ubuntu1
* New upstream release (LP: #286667)
  - General:
    - Fix up compatiblity with Gtk/Glib 2.14
    - Reclassify Gnibbles as Arcade game not logic game
    - Read saved window configuration from correct GConf group (affects
      gnometris, gnibbles, gnobots)
  - Aisleriot:
    - Remove vestigal flowRoot elements from solitaire svg icons. They
      caused a black box when rendering.
    - Don't crash when the session manager terminates aisleriot
  - GLChess:
    - Fix crash in error handler when GGZ connection closed
    - Fix crash in empty scene when no AI engines available
    - Fix crash when have OpenGL libraries but cannot get valid display
    - Implement GGZ config parser instead of using Python config parser
      which does not handle '%' characters as GGZ does
    - Ignore GGZ server remove player/table for unknown players/tables
    - Handle exceptions loading OpenGL textures
    - Reset pause menu when starting new game
    - Only allow one new/load game dialog to be visible at once
    - Fix incorrect function call for single buffered 3D display
    - Handle fork() errors in AI processes
    - Fixes to compile in Solaris
    - Print failure to start message to stdout if cannot import GTK+
    - Handle invalid response from glRenderMode(GL_RENDER) and print
      debugging information
    - More logging messages about selection rendering bugs
    - After looking at failure case in PyOpenGL code we don't need to change
      render modes after failed to change to GL_SELECT
    - Fix potential bugs found by PyChecker
    - Fix crash when validly claiming a draw
    - Don't display failed to claim draw dialog when successfully claimed
      draw
  - GTali:
    - Undoing 5 of a kind reduces the score by 50 as there might be multiple
      scores (LP: #238978)
  - Sudoku:
    - Add not overwrite time and also remember to actually save the time in
      the file (LP: #279616)
    - Correct typo in error message that led to an exception
  - Gnotravex:
    - Stop paused tiles becoming visible after changing colour settings
  - Blackjack:
    - Fix compiler warnings

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
import pygtk
16
16
pygtk.require('2.0')
17
17
 
 
18
# Ignore any exceptions writing to stdout using print statements
 
19
class SafeStdout:
 
20
    def __init__(self):
 
21
        self.stdout = sys.stdout
 
22
    
 
23
    def fileno(self):
 
24
        return self.stdout.fileno()
 
25
 
 
26
    def write(self, data):
 
27
        try:
 
28
            self.stdout.write(data)
 
29
        except:
 
30
            pass
 
31
sys.stdout = SafeStdout()
 
32
 
18
33
# Setup bugbuddy to report unhandled exceptions.
19
34
try: 
20
35
    import bugbuddy
24
39
    pass
25
40
 
26
41
def report_error():
27
 
    import gtk
28
42
    import os.path
29
43
    import gettext
30
44
    from gettext import gettext as _
31
 
        
 
45
 
32
46
    gettext.bindtextdomain('gnome-games', os.path.join('@prefix@', 'share', 'locale'))
33
47
    gettext.textdomain('gnome-games')
 
48
    # Translators: This is the title of the dialog displayed if glChess cannot start
34
49
    title = _("Chess incorrectly installed")
 
50
    # Translators: This is the contents of the dialog displayed if glChess cannot start
35
51
    description = _("""Chess is not able to start because required application files are not installed. If you are currently upgrading your system please wait until the upgrade has completed.""")
36
 
    dialog = gtk.MessageDialog(type = gtk.MESSAGE_ERROR, message_format = title)
37
 
    dialog.format_secondary_text(description)
38
 
    dialog.add_button(gtk.STOCK_QUIT, gtk.RESPONSE_CLOSE)
39
 
    dialog.run()
 
52
 
 
53
    try:
 
54
        import gtk
 
55
    except ImportError:
 
56
        print title
 
57
        print '-' * len(title)
 
58
        print description
 
59
    else:
 
60
        dialog = gtk.MessageDialog(type = gtk.MESSAGE_ERROR, message_format = title)
 
61
        dialog.format_secondary_text(description)
 
62
        dialog.add_button(gtk.STOCK_QUIT, gtk.RESPONSE_CLOSE)
 
63
        dialog.run()
40
64
    sys.exit(0)
41
65
 
42
66
# Chek if we are installed
49
73
try:
50
74
    # Import glChess from pyexecdir or system installation.
51
75
    from glchess.glchess import start_game
 
76
    start_game()
52
77
except ImportError:
53
78
    # Import of glChess failed. Show error message.
54
79
    report_error()
55
 
    
56
 
try:
57
 
    start_game()
58
 
except ImportError:
59
 
    # the game is not entirely installed
60
 
    report_error()
61
80