X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=bin%2Fparavis_setenv.py;h=38752d54dd17eea39b180330ed1267211e56e596;hb=35665aca0031dc689940d59cc17e148e6c61334b;hp=608a0d258b6aa53ecbc85d5c44a1e1a1acab70d5;hpb=c7c9039d845fb2a5e2eb391139af089b4bed26a5;p=modules%2Fparavis.git diff --git a/bin/paravis_setenv.py b/bin/paravis_setenv.py index 608a0d25..38752d54 100644 --- a/bin/paravis_setenv.py +++ b/bin/paravis_setenv.py @@ -1,11 +1,9 @@ -#! /usr/bin/env python -# -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2013 CEA/DEN, EDF R&D +# Copyright (C) 2007-2022 CEA/DEN, EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either -# version 2.1 of the License. +# version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,7 +17,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -import os, re +import os, re, sys # ----------------------------------------------------------------------------- @@ -27,9 +25,13 @@ def set_env( args ): """Initialize environment of PARAVIS module""" # set PV_PLUGIN_PATH to PARAVIS plug-ins paravis_plugin_dir = os.path.join( os.getenv( "PARAVIS_ROOT_DIR" ), "lib", "paraview" ) - plugin_path = re.split( ":|;", os.getenv( 'PV_PLUGIN_PATH', paravis_plugin_dir ) ) + if sys.platform == "win32": + splitsym = splitre = ";" + else: + splitsym = ":"; splitre = ":|;" + plugin_path = re.split( splitre, os.getenv( 'PV_PLUGIN_PATH', paravis_plugin_dir ) ) if paravis_plugin_dir not in plugin_path: plugin_path[0:0] = [paravis_plugin_dir] - os.environ['PV_PLUGIN_PATH'] = ";".join(plugin_path) + os.environ['PV_PLUGIN_PATH'] = splitsym.join(plugin_path) pass