#! /usr/bin/env python
# Copyright (c) 2005 Tom Hinkle You may use and distribute this
# software under the terms of the GNU General Public License, version
# 2 or later

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

try:
    from gnome_sudoku.gnome_sudoku 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 gnome_sudoku.gnome_sudoku import start_game
    except ImportError:
        import gtk
        from gettext import gettext as _
        
        title = _('Sudoku not correctly installed')
        description = _("""Sudoku 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()
