Salome HOME
Merge branch 'V7_dev'
[modules/paravis.git] / test / VisuPrs / bugs / A6.py
index 1b93507faef4978262d94edc63baf64f32b67101..7910d06ebe1cd3e8fdbcfe8006f66c0926aee27f 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright (C) 2010-2013  CEA/DEN, EDF R&D
+# Copyright (C) 2010-2016  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
@@ -23,18 +23,15 @@ import sys
 import os
 from paravistest import datadir, pictureext, get_picture_dir
 from presentations import *
-import paravis
 import pvsimple
 
-my_paravis = paravis.myParavis
-os.environ["PARAVIS_TEST_PICS"] = sys.argv[1]
 picturedir = get_picture_dir("bugs/A6")
 
 med_file_path = datadir + "fra.med"
 
 # 1. Import MED file
 print 'Importing "fra.med"....',
-my_paravis.ImportFile(med_file_path)
+pvsimple.OpenDataFile(med_file_path)
 med_reader = pvsimple.GetActiveSource()
 
 if med_reader is None:
@@ -43,18 +40,16 @@ else:
     print "OK"
 
 # 2. Create mesh
-mesh_names = get_mesh_names(med_reader)
-for mesh_name in mesh_names:
+mesh_names = get_mesh_full_names(med_reader)
+for mesh_name in [get_field_short_name(name) for name in mesh_names]:
     print "Mesh name: ", mesh_name
     mesh = MeshOnEntity(med_reader, mesh_name, EntityType.CELL)
     if mesh is None:
         raise RuntimeError, "Error"
 
     mesh.Representation = 'Wireframe'
-        
+
     pic_path = os.path.join(picturedir, mesh_name + "_Cell." + pictureext)
     pic_path = re.sub("\s+","_", pic_path)
     print "Save picture ", pic_path
     process_prs_for_test(mesh, pvsimple.GetRenderView(), pic_path)
-    
-