]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
Add verbisity to the shell command
authorSerge Rehbinder <serge.rehbinder@cea.fr>
Wed, 11 Jan 2017 14:05:07 +0000 (15:05 +0100)
committerSerge Rehbinder <serge.rehbinder@cea.fr>
Wed, 11 Jan 2017 14:05:07 +0000 (15:05 +0100)
commands/shell.py

index b246072512133ff5bbe80dd1e46e5282cf1baf79..e01d32b7802f690f259b4a7384871ed6a565c2a1 100644 (file)
@@ -46,14 +46,24 @@ def run(args, runner, logger):
         message = _("The option --command is required\n")      
         logger.write(src.printcolors.printcError(message))
         return 1
-
+    
+    # Print the input command
+    msg = _("Command to execute:\n%s\nExecution ... " % options.command)
+    logger.write(msg, 3)
+    
+    # Call the input command
     res = subprocess.call(options.command,
                           shell=True,
                           stdout=logger.logTxtFile,
                           stderr=subprocess.STDOUT)
-    
     # Format the result to be 0 (success) or 1 (fail)
     if res != 0:
         res = 1
+        logger.write(src.printcolors.printc("KO"), 3)
+    else:
+        logger.write(src.printcolors.printc("OK"), 3)
+    
+    logger.write("\n",3)
     
     return res
\ No newline at end of file