Salome HOME
adaptation cas tests
[modules/hydro.git] / doc / salome / examples / h001_importImage.py
index 184e2434db8ded5f750e665b1075495d0c2eaaf8..4c33e30ef300c1bb700d92e2f98dd083ab7f1a33 100644 (file)
@@ -10,8 +10,8 @@ salome.salome_init()
 theStudy = salome.myStudy
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
@@ -20,7 +20,8 @@ hydro_doc.SetLocalCS( 0, 0 )
 garonne_ign_01 = hydro_doc.CreateObject( KIND_IMAGE )
 garonne_ign_01.SetName( "garonne_ign_01" )
 
-garonne_ign_01.LoadImage( os.path.join(HYDRO_SAMPLES , "garonne_ign_01.png" ))
+if not(garonne_ign_01.LoadImage( os.path.join(HYDRO_SAMPLES , "garonne_ign_01.png" ))):
+  raise ValueError('problem while loading image')
 
 garonne_ign_01.SetLocalPoints( QPoint( 40, 817 ),
                                QPoint( 1325, 85 ) )