Salome HOME
Copyright update 2022
[modules/paravis.git] / bin / paravis_setenv.py
index 608a0d258b6aa53ecbc85d5c44a1e1a1acab70d5..38752d54dd17eea39b180330ed1267211e56e596 100644 (file)
@@ -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