6 # Preliminary work to initialize path to SALOME Python modules
8 currentPath = os.path.dirname( os.path.abspath( __file__ ) )
9 homePath = os.path.realpath(os.path.expanduser('~'))
10 appliPath = os.path.relpath(currentPath, homePath)
12 pattern = "/bin/salome/appliskel"
13 if appliPath.endswith(pattern):
14 appliPath = appliPath[:-len(pattern)]
16 absoluteAppliPath = os.path.join(homePath, appliPath)
17 os.environ['APPLI'] = appliPath # needed to convert .sh environment files
18 os.environ['ABSOLUTE_APPLI_PATH'] = absoluteAppliPath
20 sys.path[:0] = [absoluteAppliPath+'/bin/salome']
22 # define folder to store omniorb config (initially in virtual application folder)
24 from salomeLauncherUtils import setOmniOrbUserPath
29 # End of preliminary work
32 # Identify application path then locate configuration files
35 if args == ['--help']:
36 from salomeRunner import usage
40 from salomeLauncherUtils import getConfigFileNames
41 configFileNames, args, unexisting = getConfigFileNames(args, checkExistence=True)
42 if len(unexisting) > 0:
43 print "ERROR: unexisting configuration file(s): " + ', '.join(unexisting)
46 # Create a SalomeRunner which parses configFileNames to initialize environment
48 from salomeRunner import SalomeRunner, SalomeRunnerException
49 runner = SalomeRunner(configFileNames)
51 # Here set specific variables, if needed
52 # runner.addToPath('mypath')
53 # runner.addToLdLibraryPath('myldlibrarypath')
54 # runner.addToPythonPath('mypythonpath')
55 # runner.setEnviron('myvarname', 'value')
57 # Start SALOME, parsing command line arguments
59 print 'Thank you for using SALOME!'
61 except SalomeRunnerException, e:
63 logging.getLogger("salome").error(e)
67 if __name__ == "__main__":