Salome HOME
Avoid redundant messages
authorvsr <vsr@opencascade.com>
Tue, 13 Nov 2018 07:18:33 +0000 (10:18 +0300)
committervsr <vsr@opencascade.com>
Tue, 13 Nov 2018 07:18:33 +0000 (10:18 +0300)
- MEDCoupling has been renamed to medcoupling
- Show INF and DBG messages in verbose mode only

doc/tut/medcoupling/partition.py
doc/tut/medcoupling/testmed_gendata.py
doc/tut/medcoupling/testmed_lena.py
doc/tut/medcoupling/testmed_simple.py
doc/tut/medcoupling/testpil.py
doc/tut/medloader/testamel.py
src/MEDCalc/tui/__init__.py
src/MEDCalc/tui/fieldproxy.py
src/MEDCalc/tui/medimages.py
src/MEDCouplingCorba_Swig/MEDCouplingCorbaSwigTest.py

index 624000a47964319dc611bee0468f50b649397768..76cf132c731d9675caf80514051984639c6921ec 100644 (file)
@@ -26,7 +26,7 @@
 # WRN: this use case does not require a med input file because the
 # data (mesh and field) to work with are created from scratch. 
 
-from MEDCoupling import *
+from medcoupling import *
 
 # =======================================================
 # Creation of the input data (mesh and field) 
index e3bc9daaba80ceee48f99239eb0856ed78a801f6..ef99cb99a37f68c5bfcbd3a0cd1e41fd9209399c 100755 (executable)
@@ -24,7 +24,7 @@
 # fields when defined on a cartesian mesh (grid).
 # (gboulant - 11/07/2011)
 
-import MEDCoupling as MC
+import medcoupling as MC
 import MEDLoader as ML
 
 import numpy
index 3849d0f8217ab6e5b9f3f4aba0db79f37309c4a6..740bf7d85294bd6b39e10cca19d8f2482872eb52 100755 (executable)
@@ -25,7 +25,7 @@
 
 import os
 
-import MEDCoupling as MC
+import medcoupling as MC
 import MEDLoader as ML
 
 #
index 9801976d9a2f171a97dff7f6cebc4ed91d3bfa0a..4fd38f667cc65ab58f9ff07906607d428a54a4df 100755 (executable)
@@ -23,7 +23,7 @@
 # and save all the stuff in a med file.
 # (gboulant - 27/06/2011)
 
-import MEDCoupling as MC
+import medcoupling as MC
 import MEDLoader as ML
 
 #
index c93ef1337f42ce8e7b2ab5098893da9a7cfe3e5a..8516405b1685c8966c5ccef7765f58426c4119c8 100755 (executable)
@@ -58,7 +58,7 @@ def image2matrix():
     print(matrix)
     print(list(matrix))
 
-import MEDCoupling as MC
+import medcoupling as MC
 import MEDLoader as ML
 def createMesh(meshname, sizeX, sizeY):
     """
index 1021cbc976e3fdf6cb14dcfcb8bb41d7f50df972..e6f7842024ac4e9f8e23f84ca3bed82db58379a1 100644 (file)
@@ -25,7 +25,7 @@
 #
 # (gboulant, nov. 2012)
 from MEDLoader import *
-from MEDCoupling import *
+from medcoupling import *
 
 import os
 filename = "timeseries.med"
index 471500800baae22758c4ec58cbd3f5cf81f78b9a..deeb66ff6760705d802075930b19f6e0d24205fb 100644 (file)
 # This functions are to be used to notify the USER of some events
 # arising on the field operation. It is NOT to be used for logging
 # purpose
+def print_verbose(function):
+    from functools import wraps
+    @wraps(function)
+    def wrapper(self, *args, **kwargs):
+        from salome_utils import verbose
+        if verbose():
+            function(self, *args, **kwargs)
+    return wrapper
+@print_verbose
 def inf(msg): print("INF: "+str(msg))
 def wrn(msg): print("WRN: "+str(msg))
 def err(msg): print("ERR: "+str(msg))
+@print_verbose
 def dbg(msg): print("DBG: "+str(msg))
 
 # Initialize CORBA stuff
index 2a5215c25ba7c25eaa9a23b4cb1e38a895fe3915..52c0e7bb9eea245463605f7338e891b56da16731 100644 (file)
@@ -29,14 +29,14 @@ calculator  = factory.getCalculator()
 # Some helper functions to deal with the fields and meshes
 import sys
 if sys.platform == "win32":
-  import MEDCouplingCompat as MEDCoupling
+  import MEDCouplingCompat as medcoupling
 else:
-  import MEDCoupling
+  import medcoupling
 __mapTypeOfFieldLabel = {
-  MEDCoupling.ON_CELLS:    "ON_CELLS",
-  MEDCoupling.ON_NODES:    "ON_NODES",
-  MEDCoupling.ON_GAUSS_PT: "ON_GAUSS_PT",
-  MEDCoupling.ON_GAUSS_NE: "ON_GAUSS_NE"
+  medcoupling.ON_CELLS:    "ON_CELLS",
+  medcoupling.ON_NODES:    "ON_NODES",
+  medcoupling.ON_GAUSS_PT: "ON_GAUSS_PT",
+  medcoupling.ON_GAUSS_NE: "ON_GAUSS_NE"
   }
 #
 def _typeOfFieldLabel(typeOfField):
@@ -92,7 +92,9 @@ class FieldProxy:
     """
     self.__fieldHandler = fieldHandler
     self.__restriction  = None
-    print(self.__repr__())
+    from salome_utils import verbose
+    if verbose():
+      print(self.__repr__())
   #
   def __getattr__(self, name ):
     """
@@ -407,7 +409,9 @@ class FieldProxy:
     notifyGui_updateField(self.id)
 
     # Print for visual control
-    print(self.__repr__())
+    from salome_utils import verbose
+    if verbose():
+      print(self.__repr__())
   #
 #
 
index e36ad86b4aedb2df140e9092cded02ced49277e8..78dd01628f51dfeacf69e7d024179db8a2c6ecaa 100644 (file)
@@ -24,7 +24,7 @@ import sys
 if sys.platform == "win32":
   import MEDCouplingCompat as MC
 else:
-  import MEDCoupling as MC
+  import medcoupling as MC
 
 import MEDLoader as ML
 
index 272329a6cdf33807eb06f38555af68925f5bd322..9d3adbb86ab1195f62df775fc472b86b69a06c3f 100644 (file)
@@ -18,7 +18,7 @@
 #
 # Author : Anthony Geay (CEA/DEN)
 
-from MEDCoupling import *
+from medcoupling import *
 import math
 import os