X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fexamples%2Fh006_importBathyXYZBad.py;h=a5dae4f55ff9447f523347eff97e13b8ffd02532;hb=42dcc2cd86f39c7d5994913a967f5c1986c5b7b6;hp=3a24a9f2fc93c26e44b078d44180400d403fbdf4;hpb=cde2ec476486fcd7c9b7b38ce814c648d73e7fd3;p=modules%2Fhydro.git diff --git a/doc/salome/examples/h006_importBathyXYZBad.py b/doc/salome/examples/h006_importBathyXYZBad.py index 3a24a9f2..a5dae4f5 100644 --- a/doc/salome/examples/h006_importBathyXYZBad.py +++ b/doc/salome/examples/h006_importBathyXYZBad.py @@ -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() ) @@ -21,12 +21,10 @@ Cloud_inexistant = hydro_doc.CreateObject( KIND_BATHYMETRY ) Cloud_inexistant.SetName( "Cloud_inexistant" ) Cloud_inexistant.SetAltitudesInverted( 0 ); -Cloud_inexistant.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_inexistant.xyz" )) +ret = Cloud_inexistant.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_inexistant.xyz" )) -# TODO : ce chargement doit echouer avec un retour d'erreur à traiter -raise ValueError('file not found') - -Cloud_inexistant.Update() +if ret: + raise ValueError('loading problem not detected: return value should be null') if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(1)