gnome-games r7728 - trunk/glchess/src
- From: jclinton svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-games r7728 - trunk/glchess/src
- Date: Sun, 22 Jun 2008 23:37:31 +0000 (UTC)
Author: jclinton
Date: Sun Jun 22 23:37:31 2008
New Revision: 7728
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7728&view=rev
Log:
Give users a helpful error message when python-support has missing
modules. (Jason Clinton, Justin Dugger, Dani Nordli, Bug #524665)
Modified:
trunk/glchess/src/glchess.in.in
Modified: trunk/glchess/src/glchess.in.in
==============================================================================
--- trunk/glchess/src/glchess.in.in (original)
+++ trunk/glchess/src/glchess.in.in Sun Jun 22 23:37:31 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]