mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-14 11:04:29 +05:00
gcode_shell_command: make RUN_SHELL_COMMAND accept optional parameters
Thanks @lixxbox for that code
This commit is contained in:
@@ -46,10 +46,12 @@ class ShellCommand:
|
|||||||
|
|
||||||
cmd_RUN_SHELL_COMMAND_help = "Run a linux shell command"
|
cmd_RUN_SHELL_COMMAND_help = "Run a linux shell command"
|
||||||
def cmd_RUN_SHELL_COMMAND(self, params):
|
def cmd_RUN_SHELL_COMMAND(self, params):
|
||||||
|
gcode_params = params.get('PARAMS','')
|
||||||
|
gcode_params = shlex.split(gcode_params)
|
||||||
reactor = self.printer.get_reactor()
|
reactor = self.printer.get_reactor()
|
||||||
try:
|
try:
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
self.command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
self.command + gcode_params, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.exception(
|
logging.exception(
|
||||||
"shell_command: Command {%s} failed" % (self.name))
|
"shell_command: Command {%s} failed" % (self.name))
|
||||||
|
|||||||
Reference in New Issue
Block a user