Salome HOME
sat #8691 (finalisation) : ajout message explicite d'erreur si pas de script lors...
authorcrouzet <nicolas.crouzet@cea.fr>
Tue, 5 Feb 2019 10:30:22 +0000 (11:30 +0100)
committercrouzet <nicolas.crouzet@cea.fr>
Tue, 5 Feb 2019 10:30:22 +0000 (11:30 +0100)
commands/script.py
src/debug.py
src/logger.py
src/product.py

index 575b56dbfe9365ac6f9fee7f8a5e458974ca2bcc..7345977be0c0c23ec96f683c2e20a4fd1466a4af 100644 (file)
@@ -97,6 +97,13 @@ def run_script_of_product(p_name_info, nb_proc, config, logger):
         logger.write("\n", 3, False)
         return 0
 
+    if not os.path.isfile(p_info.compil_script):
+        msg_err="\n\nError : The compilation script file do not exists!"+\
+                "\n        It was not found by sat!"+\
+                "\n        Please check your salomeTool configuration\n"
+        logger.error(msg_err)
+        return 1
+
     # Instantiate the class that manages all the construction commands
     # like cmake, make, make install, make test, environment management, etc...
     builder = src.compilation.Builder(config, logger, p_info)
index 1b8cc470fbb343aca677fd6808f9a14d03863fbe..1f48125014162a65107b92d88c04d26e6ccc4fa0 100755 (executable)
@@ -118,8 +118,9 @@ def tofix(title, var="", force=None):
     write sys.stderr a message if _debug[-1]==True or optionaly force=True
     use this only if no logger accessible for classic logger.warning(message)
     """
-    fmt = "\n#### TOFIX: %s:\n%s\n"
-    write(title, var, force, fmt)
+    if _debug[-1] or isDeveloper():
+        fmt = "\n#### TOFIX: %s:\n%s\n"
+        write(title, var, force, fmt)
 
 def push_debug(aBool):
     """set debug outputs activated, or not"""
index 260b2ff456cba79674c005be97544e8cdb8a740b..439b540cbbd20e5cd26b04a7215569769b7c94c4 100755 (executable)
@@ -549,7 +549,7 @@ def isCurrentLoggerUnittest():
       res = True
     else:
       res = False
-    DBG.write("isCurrentLoggerUnittest %s" % logger.name, res)
+    #DBG.write("isCurrentLoggerUnittest %s" % logger.name, res)
     return res
 
 def sendMessageToCurrentLogger(message, level):
index 11ab0019eb9db11e9b5b5ba1240b121a96462e14..f2fe8dd2548f2a88991c0e25f7888dac29904b88 100644 (file)
@@ -295,18 +295,12 @@ Please provide a 'compil_script' key in its definition.""") % product_name
             if not script_path:
                 msg = _("Compilation script %s not found in") % script_name
                 DBG.tofix(msg, config.PATHS.PRODUCTPATH, True) # say where searched
-                # avoid stop if sat prepare, script could be included in sources, only warning
-                # raise src.SatException(msg)
-                script_path = "*** Not Found: %s" % script_name
+                script_path = "%s_(Not_Found_by_Sat!!)" % script_name
             prod_info.compil_script = script_path
 
        
         # Check that the script is executable
         if os.path.exists(prod_info.compil_script) and not os.access(prod_info.compil_script, os.X_OK):
-            #raise src.SatException(
-            #        _("Compilation script cannot be executed: %s") % 
-            #        prod_info.compil_script)
-            # just as warning, problem later...
             DBG.tofix("Compilation script  file is not in 'execute mode'", prod_info.compil_script, True)
     
     # Get the full paths of all the patches