#! /usr/bin/env python

# Setup bugbuddy to report unhandled exceptions.
try: 
  import bugbuddy
  bugbuddy.install('glchess')
except:
  #No bugbuddy support
  pass

try:
    from glchess.glchess import start_game
except ImportError:
    import sys
    if "/usr/local/lib/python2.4/site-packages" not in sys.path:
        sys.path.insert(0, "/usr/local/lib/python2.4/site-packages")

    try:
        from glchess.glchess import start_game
    except ImportError:
        import gtk
        from gettext import gettext as _
        
        title = _('Chess not correctly installed')
        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.""")
        dialog = gtk.MessageDialog(type = gtk.MESSAGE_ERROR, message_format = title)
        dialog.format_secondary_text(description)
        dialog.add_button(gtk.STOCK_QUIT, gtk.RESPONSE_CLOSE)
        dialog.run()
        sys.exit(0)

start_game()
