X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=inline;f=bin%2Fsetenv.py;h=6555866197cc3b0a36460a2f10bfa85f3c4f12ee;hb=28ccecc39947373ea231ff46a3d0c9a5c2448bc3;hp=4858eb4cef4832f26137aa89678a6d9941cc341d;hpb=731335c587a8e83d29ffaadffc5fcf72d42c5cfb;p=modules%2Fkernel.git diff --git a/bin/setenv.py b/bin/setenv.py index 4858eb4ce..655586619 100755 --- a/bin/setenv.py +++ b/bin/setenv.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -39,28 +39,21 @@ salome_subdir = "salome" def add_path(directory, variable_name): """Function helper to add environment variables""" - if sys.platform == "win32": - splitsym = ";" - else: - splitsym = ":" if variable_name not in os.environ: os.environ[variable_name] = "" pass if os.path.exists(directory): newpath=[] - for _dir in os.environ[variable_name].split(splitsym): + for _dir in os.environ[variable_name].split(os.pathsep): if os.path.exists(_dir): - if sys.platform != "win32": - if not os.path.samefile(_dir, directory): - newpath.append(_dir) - else: + if not os.path.samefile(_dir, directory): newpath.append(_dir) else: if os.path.abspath(_dir) != os.path.abspath(directory): newpath.append(_dir) pass newpath[:0] = [ directory ] - newpath = splitsym.join(newpath) + newpath = os.pathsep.join(newpath) os.environ[variable_name] = newpath if variable_name == "PYTHONPATH": sys.path[:0] = [os.path.realpath(directory)] @@ -238,12 +231,6 @@ def set_env(args, modules_list, modules_root_dir, silent=False, keepEnvironment= if args['logger']: os.environ["SALOME_trace"]="with_logger" - # set resources variables if not yet set - - os.environ["CSF_SALOMEDS_ResourcesDefaults"] \ - = os.path.join(modules_root_dir["KERNEL"],"share", - salome_subdir,"resources","kernel") - # ----------------------------------------------------------------------------- def main(silent=False, exeName=None):