Salome HOME
Fixed problem with dump study and small optimization:
[modules/kernel.git] / bin / appliskel / salome
index 1bcae77fa2d19aecd706a525e147ba81925521f1..90d5e1028a1ad5c8a8222d2aa086dac4406aadb2 100755 (executable)
@@ -1,6 +1,6 @@
 #! /usr/bin/env python
 
-# Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2016  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
@@ -35,9 +35,10 @@ def main(args):
     sys.exit(0)
 
   from salomeContextUtils import getConfigFileNames
-  configFileNames, args, unexisting = getConfigFileNames(args, checkExistence=True)
+  configFileNames, extraEnv, args, unexisting = getConfigFileNames(args, checkExistence=True)
+
   if len(unexisting) > 0:
-    print "ERROR: unexisting configuration file(s): " + ', '.join(unexisting)
+    print "ERROR: unexisting configuration/environment file(s): " + ', '.join(unexisting)
     sys.exit(1)
 
   # Create a SalomeContext which parses configFileNames to initialize environment
@@ -52,8 +53,12 @@ def main(args):
     # context.addToPythonPath('mypythonpath')
     # context.setVariable('myvarname', 'value')
 
+    if extraEnv:
+      for key,val in extraEnv.items():
+        context.addToVariable(key,val)
+
     # Start SALOME, parsing command line arguments
-    (out, err), returncode = context.runSalome(args)
+    out, err, returncode = context.runSalome(args)
     if out:
       sys.stdout.write(out)
     if err: