Salome HOME
Merge V8_4_BR branch.
[modules/kernel.git] / bin / appliskel / salome
1 #! /usr/bin/env python
2
3 import os
4 import subprocess
5 import sys
6
7 MODULES = []
8
9
10 def main(args):
11     ''' Load modules then launch salome
12     '''
13     if MODULES:
14         env_modules = MODULES[:]
15         env_modules_option = "--with-env-modules="
16         env_modules_l = [x for x in args if x.startswith(env_modules_option)]
17         if env_modules_l:
18           env_modules += env_modules_l[-1][len(env_modules_option):].split(',')
19           args = [x for x in args if not x.startswith(env_modules_option)]
20         env_modules_option += "%s" % ','.join(env_modules)
21         args.append(env_modules_option)
22
23     appliPath = os.path.realpath(os.path.dirname(os.path.abspath(__file__)))
24     proc = subprocess.Popen([os.path.join(appliPath, '.salome_run')] + args, close_fds=True)
25     out, err = proc.communicate()
26     sys.exit(proc.returncode)
27
28 if __name__ == "__main__":
29     main(sys.argv[1:])
30 #
31