Salome HOME
projects
/
modules
/
kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
For future compatibility with python 3.9.
[modules/kernel.git]
/
bin
/
setenv.py
diff --git
a/bin/setenv.py
b/bin/setenv.py
index 4858eb4cef4832f26137aa89678a6d9941cc341d..6555866197cc3b0a36460a2f10bfa85f3c4f12ee 100755
(executable)
--- a/
bin/setenv.py
+++ b/
bin/setenv.py
@@
-1,6
+1,6
@@
#!/usr/bin/env python3
# -*- coding: iso-8859-1 -*-
#!/usr/bin/env python3
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-20
19
CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-20
21
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
#
# 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"""
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=[]
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 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.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)]
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"
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):
# -----------------------------------------------------------------------------
def main(silent=False, exeName=None):