gnome-games r7752 - in branches/gnome-2-22/glchess: . src



Author: jclinton
Date: Sun Jun 29 19:54:51 2008
New Revision: 7752
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7752&view=rev

Log:
Give users a helpful error message when python-support has missing
modules. (Jason Clinton, Justin Dugger, Dani Nordli, Bug #524665)

Modified:
   branches/gnome-2-22/glchess/ChangeLog
   branches/gnome-2-22/glchess/src/glchess.in.in

Modified: branches/gnome-2-22/glchess/src/glchess.in.in
==============================================================================
--- branches/gnome-2-22/glchess/src/glchess.in.in	(original)
+++ branches/gnome-2-22/glchess/src/glchess.in.in	Sun Jun 29 19:54:51 2008
@@ -23,18 +23,7 @@
   #No bugbuddy support
   pass
 
-# Chek if we are installed
-root_dir = os.path.dirname(__file__)
-if os.path.exists(os.path.join(root_dir, 'Makefile.am')):
-    sys.path.insert(0, os.path.abspath(root_dir))
-    import lib
-    sys.modules['glchess'] = sys.modules['lib']
-
-try:
-    # Import glChess from pyexecdir or system installation.
-    from glchess.glchess import start_game
-except ImportError:
-    # Import of glChess failed. Show error message.
+def report_error():
     import gtk
     import os.path
     import gettext
@@ -50,4 +39,23 @@
     dialog.run()
     sys.exit(0)
 
-start_game()
+# Chek if we are installed
+root_dir = os.path.dirname(__file__)
+if os.path.exists(os.path.join(root_dir, 'Makefile.am')):
+    sys.path.insert(0, os.path.abspath(root_dir))
+    import lib
+    sys.modules['glchess'] = sys.modules['lib']
+
+try:
+    # Import glChess from pyexecdir or system installation.
+    from glchess.glchess import start_game
+except ImportError:
+    # Import of glChess failed. Show error message.
+    report_error()
+    
+try:
+    start_game()
+except ImportError:
+    # the game is not entirely installed
+    report_error()
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]