gnome-games r7134 - in trunk: glchess/src gnome-sudoku/src



Author: andreasr
Date: Fri Jan 11 21:15:53 2008
New Revision: 7134
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7134&view=rev

Log:
Change priority of importing source code:
1. Run from source.
2. Run from installed path.
3. Run from installed path (with pyexecdir in path).


Modified:
   trunk/glchess/src/glchess.in.in
   trunk/gnome-sudoku/src/gnome-sudoku.in.in

Modified: trunk/glchess/src/glchess.in.in
==============================================================================
--- trunk/glchess/src/glchess.in.in	(original)
+++ trunk/glchess/src/glchess.in.in	Fri Jan 11 21:15:53 2008
@@ -12,24 +12,26 @@
 installed_mode = True
 
 try:
-    # Import glchess from system installation.
+    # Import glchess module from source distribution.
+    import lib;
+    sys.modules["glchess"] = sys.modules["lib"];
     from glchess.glchess import start_game
-except ImportError:
-    import sys
-    if "@pyexecdir@" not in sys.path:
-        sys.path.insert(0, "@pyexecdir@")
+    installed_mode = False
 
+except ImportError:
     try:
-	# Import glchess from system installation (with pyexecdir in path).
-        from glchess.glchess import start_game
+      # Import glchess from system installation.
+      installed_mode = True
+      from glchess.glchess import start_game
     except ImportError:
+      import sys
+      if "@pyexecdir@" not in sys.path:
+          sys.path.insert(0, "@pyexecdir@")
 
       try:
-	  # Import glchess module from source distribution.
-          import lib;
-          sys.modules["glchess"] = sys.modules["lib"];
+          # Import glchess from system installation (with pyexecdir in path).
           from glchess.glchess import start_game
-	  installed_mode = False
+
       except ImportError:
 	  # Import of glchess failed. Show error message.
           import gtk

Modified: trunk/gnome-sudoku/src/gnome-sudoku.in.in
==============================================================================
--- trunk/gnome-sudoku/src/gnome-sudoku.in.in	(original)
+++ trunk/gnome-sudoku/src/gnome-sudoku.in.in	Fri Jan 11 21:15:53 2008
@@ -15,24 +15,26 @@
 installed_mode = True
 
 try:
-    # Import gnome-sudoku from system installation.
+    # Import gnome-sudoku module from source distribution.
+    import lib;
+    sys.modules["gnome_sudoku"] = sys.modules["lib"];
     from gnome_sudoku.gnome_sudoku import start_game
-except ImportError:
-    import sys
-    if "@pyexecdir@" not in sys.path:
-        sys.path.insert(0, "@pyexecdir@")
+    installed_mode = False
 
+except ImportError:
     try:
-	# Import gnome-sudoku from system installation (with pyexecdir in path).
-        from gnome_sudoku.gnome_sudoku import start_game
+      # Import gnome-sudoku from system installation.
+      installed_mode = True
+      from gnome_sudoku.gnome_sudoku import start_game
     except ImportError:
+      import sys
+      if "@pyexecdir@" not in sys.path:
+          sys.path.insert(0, "@pyexecdir@")
 
       try:
-	  # Import gnome_sudoku module from source distribution.
-          import lib;
-          sys.modules["gnome_sudoku"] = sys.modules["lib"];
+          # Import gnome-sudoku from system installation (with pyexecdir in path).
           from gnome_sudoku.gnome_sudoku import start_game
-	  installed_mode = False
+
       except ImportError:
 	  # Import of gnome-sudoku failed. Show error message.
           import gtk



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