Salome HOME
Merge V8_4_BR branch.
[modules/kernel.git] / bin / appliskel / salome_starter.py
index 215a49e8d4e6a27c1b01205b62004c67e4b7f20f..795803d408da1eae96165d06d999acdb554565a8 100644 (file)
@@ -1,6 +1,6 @@
 #! /usr/bin/env python
 
-# Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2014-2017  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -33,7 +33,7 @@ def __detectAppliPath(fromPath, launcherFile):
   if os.path.isdir(users_folder):
     return fromPath
 
-  pattern = "/bin/salome/appliskel"
+  pattern = os.path.sep + os.path.join("bin", "salome", "appliskel")
   if fromPath.endswith(pattern):
     currentPath = __detectAppliPath(fromPath[:-len(pattern)], launcherFile)
     if not currentPath is None:
@@ -54,14 +54,15 @@ def initialize(launcherPath, launcherFile):
 
   if appliPath is None:
     print "ERROR: Unable to find application folder"
-    sys.exit(0)
+    sys.exit(1)
 
   appliPath = os.path.relpath(appliPath, homePath)
   absoluteAppliPath = os.path.join(homePath, appliPath)
   os.environ['APPLI'] = appliPath # needed to convert .sh environment files
   os.environ['ABSOLUTE_APPLI_PATH'] = absoluteAppliPath
 
-  sys.path[:0] = [absoluteAppliPath+'/bin/salome']
+  sys.path[:0] = [os.path.realpath(os.path.join(absoluteAppliPath, "bin", "salome", "test"))]
+  sys.path[:0] = [os.path.realpath(os.path.join(absoluteAppliPath, "bin", "salome"))]
 
   # define folder to store omniorb config (initially in virtual application folder)
   try: