-# SALOME SALOME_SWIG : binding of C++ implementation and Python
+# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003 CEA/DEN, EDF R&D
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# 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.
#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# SALOME SALOME_SWIG : binding of C++ implementation and Python
# File : salome_test.py
# Module : SALOME
-
+#
print "Test the application loading GEOM, SMESH, VISU, MED, components and doing some"
print "operation within the components."
smesh.Compute(mesh, box)
sg.updateObjBrowser(1);
-if sys.platform != "win32":
- print
- print "============= Test Supervisor ============================="
- print
-
+#####################################################################
+# SUPERVISOR module is not available since SALOME 5.0 version
+#####################################################################
+print
+print "============= Test Supervisor ============================="
+print
+import salome_version
+versions = salome_version.getVersions()
+if versions[0] < 5:
+ # SUPERV module is avaiable
comp = catalog.GetComponent("SUPERV")
if comp is None:
raise RuntimeError,"Component SUPERV not found in Module Catalog."
sg.updateObjBrowser(1);
pass
+else:
+ # SUPERV module is NOT avaiable
+ print "WARNING! Supervisor is not avaiable in this version of SALOME!"
+ pass
print
print "============= Test VISU and MED ============================="
import visu_gui
medFileName = "pointe.med"
-medFile = os.getenv('DATA_DIR') + '/MedFiles/' + medFileName
+if sys.platform != "win32":
+ medFile = os.getenv('DATA_DIR') + '/MedFiles/' + medFileName
+else:
+ medFile = os.getenv('DATA_DIR') + '\\MedFiles\\' + medFileName
+ pass
print "Load ", medFile
studyCurrent = salome.myStudyName
if sys.platform != "win32":
tmpDir = "/tmp/"
else:
- tmpDir = os.getenv('TEMP') + '/'
+ tmpDir = os.getenv('TEMP') + '\\'
medFileNew = tmpDir + str(random.randint(0,1000000)) + "_" + medFileName
print " -- Copy " + medFile + " to " + medFileNew
os.system(copyCommand + " " + medFile + " " + medFileNew)
medFile = medFileNew
- os.system("chmod 755 " + medFile)
+ if sys.platform != "win32":
+ os.system("chmod 755 " + medFile)
+ pass
if os.access(medFile, os.W_OK) :
med_comp.readStructFileWithFieldType(medFile,studyCurrent)