Salome HOME
projects
/
modules
/
hydro.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
modification cas telemac, non fonctionnel
[modules/hydro.git]
/
doc
/
salome
/
examples
/
h006_importBathyXYZBad.py
diff --git
a/doc/salome/examples/h006_importBathyXYZBad.py
b/doc/salome/examples/h006_importBathyXYZBad.py
index 3a24a9f2fc93c26e44b078d44180400d403fbdf4..a5dae4f55ff9447f523347eff97e13b8ffd02532 100644
(file)
--- 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 *
theStudy = salome.myStudy
from HYDROPy import *
-from PyQt
4
.QtCore import *
-from PyQt
4
.QtGui import *
+from PyQt
5
.QtCore import *
+from PyQt
5
.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
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.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)
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)