Commit f23db989 authored by Guillaume Seguin's avatar Guillaume Seguin

Add run_script host command (#451, #483)

parent 5ed53448
...@@ -1781,6 +1781,14 @@ class pronsole(cmd.Cmd): ...@@ -1781,6 +1781,14 @@ class pronsole(cmd.Cmd):
self.log(_("G-Code calling host command \"%s\"") % command) self.log(_("G-Code calling host command \"%s\"") % command)
self.onecmd(command) self.onecmd(command)
def do_run_script(self, l):
p = run_command(l, {"%s": str(self.filename)}, stdout = subprocess.PIPE)
for line in p.stdout.readlines():
self.log("<< " + line.strip())
def help_run_script(self):
self.log(_("Runs a custom script. Current gcode filename can be given using %s token."))
def do_run_gcode_script(self, l): def do_run_gcode_script(self, l):
p = run_command(l, {"%s": str(self.filename)}, stdout = subprocess.PIPE) p = run_command(l, {"%s": str(self.filename)}, stdout = subprocess.PIPE)
for line in p.stdout.readlines(): for line in p.stdout.readlines():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment