3 # Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
26 # Identify application path then locate configuration files
27 currentPath = os.path.realpath(os.path.dirname(os.path.abspath(__file__)))
28 launcherFile = os.path.basename(__file__)
29 from salome_starter import initialize
30 initialize(currentPath, launcherFile)
32 if len(args) == 1 and args[0] in ['--help', 'help', '-h', '--h']:
33 from salomeContext import usage
37 from salomeContextUtils import getConfigFileNames
38 configFileNames, args, unexisting = getConfigFileNames(args, checkExistence=True)
39 if len(unexisting) > 0:
40 print "ERROR: unexisting configuration file(s): " + ', '.join(unexisting)
43 # Create a SalomeContext which parses configFileNames to initialize environment
44 from salomeContextUtils import SalomeContextException
46 from salomeContext import SalomeContext
47 context = SalomeContext(configFileNames)
49 # Here set specific variables, if needed
50 # context.addToPath('mypath')
51 # context.addToLdLibraryPath('myldlibrarypath')
52 # context.addToPythonPath('mypythonpath')
53 # context.setVariable('myvarname', 'value')
55 # Start SALOME, parsing command line arguments
56 (out, err), returncode = context.runSalome(args)
61 #print 'Thank you for using SALOME!'
63 except SalomeContextException, e:
65 logging.getLogger("salome").error(e)
69 if __name__ == "__main__":