diff options
author | Alec B. Plumb <alec@etherwalker.com> | 2019-01-02 14:45:35 -0800 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2019-01-02 17:45:35 -0500 |
commit | 59e9b6562fb39c1e4860971e818e94a455622547 (patch) | |
tree | c257eaab9c71f3c13b9d3e6590f3ae43e68d1ea7 /klippy/gcode.py | |
parent | f6c9150349d3ffb364a990132a16afa64c890b2e (diff) | |
download | kutter-59e9b6562fb39c1e4860971e818e94a455622547.tar.gz kutter-59e9b6562fb39c1e4860971e818e94a455622547.tar.xz kutter-59e9b6562fb39c1e4860971e818e94a455622547.zip |
respond: An extra for sending messages to the printer host. (#1053)
I have made one change to `gcode.py` to support quoted parameter
values.
I have added support for the basic `M118` command (see
https://reprap.org/wiki/G-code#M118:_Echo_message_on_host). I have
also added a `RESPOND` command that takes extended parameters.
`ECHO` might be a better name than `RESPOND` but is already defined
in `gcode.py`.
Signed-off-by: Alec B. Plumb <alec@etherwalker.com>
Diffstat (limited to 'klippy/gcode.py')
-rw-r--r-- | klippy/gcode.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py index 2897b664..c2abbf45 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -3,7 +3,7 @@ # Copyright (C) 2016-2018 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import os, re, logging, collections +import os, re, logging, collections, shlex import homing, kinematics.extruder class error(Exception): @@ -356,7 +356,7 @@ class GCodeParser: return params eargs = m.group('args') try: - eparams = [earg.split('=', 1) for earg in eargs.split()] + eparams = [earg.split('=', 1) for earg in shlex.split(eargs)] eparams = { k.upper(): v for k, v in eparams } eparams.update({k: params[k] for k in params if k.startswith('#')}) return eparams |