]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0021559: EDF 2175 SMESH: Hexa/Tetra mixed meshes (Bug2175_mixed_hexa_tetra.py)
authoreap <eap@opencascade.com>
Tue, 24 Apr 2012 14:32:58 +0000 (14:32 +0000)
committereap <eap@opencascade.com>
Tue, 24 Apr 2012 14:32:58 +0000 (14:32 +0000)
  In Mesh.Compute(), detect failure by value returned from
  Mesh._mesh.Compute() and not by presence of messages

src/SMESH_SWIG/smeshDC.py

index b067107440685b22f49bcdfb21dc826b74ffb9fd..77fdfde37fa263d664915f7a3cc6a7ef619c447a 100644 (file)
@@ -1181,7 +1181,7 @@ class Mesh:
                 if errText: errText += ". "
                 errText += err.comment
                 if allReasons != "":allReasons += "\n"
-                allReasons += '"%s" failed%s. Error: %s' %(err.algoName, shapeText, errText)
+                allReasons += '-  "%s" failed%s. Error: %s' %(err.algoName, shapeText, errText)
                 pass
 
             # Treat hyp errors
@@ -1212,15 +1212,16 @@ class Mesh:
                              " Revise Mesh.Compute() implementation in smeshDC.py!"
                     pass
                 if allReasons != "":allReasons += "\n"
-                allReasons += reason
+                allReasons += "-  " + reason
                 pass
-            if allReasons != "":
-                print '"' + GetName(self.mesh) + '"',"has not been computed:"
+            if not ok or allReasons != "":
+                msg = '"' + GetName(self.mesh) + '"'
+                if ok: msg += " has been computed with warnings"
+                else:  msg += " has not been computed"
+                if allReasons != "": msg += ":"
+                else:                msg += "."
+                print msg
                 print allReasons
-                ok = False
-            elif not ok:
-                print '"' + GetName(self.mesh) + '"',"has not been computed."
-                pass
             pass
         if salome.sg.hasDesktop() and self.mesh.GetStudyId() >= 0:
             smeshgui = salome.ImportComponentGUI("SMESH")