Revision: 450
http://python-ogre.svn.sourceforge.net/python-ogre/?rev=450&view=rev
Author: andy_miller
Date: 2007-10-21 20:57:27 -0700 (Sun, 21 Oct 2007)
Log Message:
-----------
Allow libpath override
Modified Paths:
--------------
trunk/python-ogre/demos/PythonOgreConfig.py
Modified: trunk/python-ogre/demos/PythonOgreConfig.py
===================================================================
--- trunk/python-ogre/demos/PythonOgreConfig.py 2007-10-22 03:36:58 UTC (rev 449)
+++ trunk/python-ogre/demos/PythonOgreConfig.py 2007-10-22 03:57:27 UTC (rev 450)
@@ -2,19 +2,29 @@
# a single config file that is imported 'first' by the Python-Ogre demos
# this is primarly used to manage Linux demos when we have binaries in non standard (safe) locations
-import os,sys
+import os,sys
+
+#########################################################################
+### Override this setting if you are using non standard locations
+
+libpath = ""
+
+#########################################################################
+
+
if os.name == 'nt':
libpath=""
pythonpath = ""
-else:
- localpath = os.path.abspath('.') ## should be one of the demo directories
- libpath = os.path.abspath(os.path.join(localpath,'../../lib'))
- if not os.path.exists ( libpath ): #we must be running from the development environment
- libpath = os.path.abspath(os.path.join(localpath,'../../../root/usr/lib'))
- if not os.path.exists ( libpath ):
- ## should die here
- print "**Problem finding libraries"
- libpath=localpath
+else:
+ if libpath == "" : # we need to find this ourselves
+ localpath = os.path.abspath(os.path.dirname(__file__) ) # assume that this module is in the ./demos directory
+ libpath = os.path.abspath(os.path.join(localpath,'../lib')) # so in the binary release the lib is one path back up
+ if not os.path.exists ( libpath ): #we must be running from the development environment
+ libpath = os.path.abspath(os.path.join(localpath,'../../root/usr/lib'))
+ if not os.path.exists ( libpath ):
+ ## should die here
+ print "**Problem finding libraries"
+ libpath=localpath
## path to the Python-Ogre modules
pythonpath = os.path.abspath(os.path.join(libpath, 'python2.5/site-packages') )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|