From d190a60ff7c75d5f8ee02629802f3f14404e29c8 Mon Sep 17 00:00:00 2001 From: Ruben P Date: Mon, 29 Aug 2022 23:17:51 +0200 Subject: [PATCH] add an option to terminate or not subprocess default is true (same behavior as now) --- resources/gcode_shell_command.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/gcode_shell_command.py b/resources/gcode_shell_command.py index bb38ae5..2962cf4 100755 --- a/resources/gcode_shell_command.py +++ b/resources/gcode_shell_command.py @@ -18,6 +18,7 @@ class ShellCommand: self.command = shlex.split(cmd) self.timeout = config.getfloat('timeout', 2., above=0.) self.verbose = config.getboolean('verbose', True) + self.terminate = config.getboolean('terminate', True) self.proc_fd = None self.partial_output = "" self.gcode.register_mux_command( @@ -68,7 +69,7 @@ class ShellCommand: if proc.poll() is not None: complete = True break - if not complete: + if not complete and self.terminate: proc.terminate() if self.verbose: if self.partial_output: