← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3777: Set the higher pripority in sys.path to self-compiled modules. Closes LP:1254708

 

------------------------------------------------------------
revno: 3777
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Thu 2013-12-12 14:52:40 +0100
message:
  Set the higher pripority in sys.path to self-compiled modules. Closes LP:1254708
modified:
  core/main/main.py.in


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'core/main/main.py.in'
--- core/main/main.py.in	2013-09-10 14:53:54 +0000
+++ core/main/main.py.in	2013-12-12 13:52:40 +0000
@@ -8,6 +8,13 @@
 except ImportError:
 	import io
 
+# Add search path for yade Python-modules
+# It allows to use both Yade-versions (packaged and self-compiled one).
+# See LP:1254708 for more details
+# https://bugs.launchpad.net/yade/+bug/1254708
+
+sys.path.insert(1,'${runtimePREFIX}/${LIBRARY_OUTPUT_PATH}/yade${SUFFIX}/py')
+
 # get yade path (allow YADE_PREFIX to override)
 prefix,suffix='${runtimePREFIX}' if not os.environ.has_key('YADE_PREFIX') else os.environ['YADE_PREFIX'],'${SUFFIX}'
 # duplicate some items from yade.config here, so that we can increase verbosity when the c++ part is booting
@@ -21,9 +28,6 @@
 if not (os.path.exists(libDir+'/py/yade/__init__.py')):
 	raise RuntimeError('Libraries are not found! ('+libDir+'/py/yade/__init__.py, /py/yade/__init__.py)')
 
-
-
-
 # handle command-line options first
 try:
 	import argparse