#! /usr/bin/env python

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

try:
    import pygtk
    pygtk.require('2.0')
except ImportError, err:
    print ("PyGTK not found. Please make sure it is installed properly and referenced in your PYTHONPATH environment variable.")

try:
    from glchess.glchess import start_game
except ImportError:
    import sys
    if "/home/thomas/john6/test/lib/python2.5/site-packages" not in sys.path:
        sys.path.insert(0, "/home/thomas/john6/test/lib/python2.5/site-packages")

    try:
        from glchess.glchess import start_game
    except ImportError:
        import gtk
        
        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()
