From 534239b0ac100c1845934c41a7c5f79bfb23181c Mon Sep 17 00:00:00 2001 From: bri Date: Mon, 11 Feb 2013 05:10:52 +0000 Subject: [PATCH] MPV: set python path to the Siman scripts storage for launching they in Session python console --- bin/runSalome.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/runSalome.py b/bin/runSalome.py index 9de65c8f6..4ce4ad476 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -304,7 +304,7 @@ class SessionServer(Server): self.SCMD2+=['--study-hdf=%s'%self.args['study_hdf']] pass if simanStudyName(self.args) != "": - self.SCMD2+=['--siman-study=%s'%simanStudyName(self.args)] + self.SCMD2+=['--siman-study=%s'%simanStudyName(self.args)] pass pass pass @@ -540,6 +540,12 @@ def startSalome(args, modules_list, modules_root_dir): myServer=NotifyServer(args,modules_root_dir) myServer.run() + # set siman python path before the session server launching to import scripts inside python console + if simanStudyName(args) != "": + # MPV: use os.environ here because session server is launched in separated process and sys.path in missed in this case + os.environ["PYTHONPATH"] = "/tmp/SimanSalome/" + args['siman_study'] + "/" + \ + args['siman_scenario'] + "/" + args['siman_user'] + os.pathsep + os.environ["PYTHONPATH"]; + # Launch Session Server (to show splash ASAP) # -- 2.39.2