From: Serge Rehbinder Date: Wed, 11 Jan 2017 14:05:07 +0000 (+0100) Subject: Add verbisity to the shell command X-Git-Tag: 5.0.0a1~38^2~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d04c758e0160604991b08f42d215eb18acea92ea;p=tools%2Fsat.git Add verbisity to the shell command --- diff --git a/commands/shell.py b/commands/shell.py index b246072..e01d32b 100644 --- a/commands/shell.py +++ b/commands/shell.py @@ -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